If you are running Plesk on CentOS 7, you may see errors such as:
Repository is not opened
Could not open Repository at "/etc/sw/keys"
Invalid repository: unknown or unsupported format
Plesk License Activation Failed
This usually started after CentOS 7 reached end of life.
Many servers still use old CentOS mirror URLs which now return 404 errors.
This causes yum failures, incomplete updates, and can corrupt the Plesk license repository located at /etc/sw/keys.
CentOS 7 official mirrors are no longer active.
Some systems still point to URLs like:
http://centos.mirrors.ovh.net/ftp.centos.org/7/
These URLs no longer work, which leads to broken yum operations and partially applied Plesk updates.
Edit the file:
/etc/yum.repos.d/CentOS-Base.repo
Replace its contents with the following configuration that uses CentOS Vault:
[base]
name=CentOS-7 - Base
baseurl=http://vault.centos.org/7.9.2009/os/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[updates]
name=CentOS-7 - Updates
baseurl=http://vault.centos.org/7.9.2009/updates/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-7 - Extras
baseurl=http://vault.centos.org/7.9.2009/extras/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[centosplus]
name=CentOS-7 - Plus
baseurl=http://vault.centos.org/7.9.2009/centosplus/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Then run:
yum clean all
rm -rf /var/cache/yum
yum makecache
yum update -y
If you still see errors mentioning:
/etc/sw/keys/info
Invalid repository format
Then the Plesk license repository is already corrupted and must be rebuilt.
Run the following commands as root:
systemctl stop sw-engine sw-cp-server
rm -rf /etc/sw/keys
mkdir -p /etc/sw/keys
chown root:swkey-data /etc/sw/keys
chmod 2770 /etc/sw/keys
plesk installer --select-release-current --reinstall-patch --upgrade-installed-components
systemctl start sw-engine sw-cp-server
plesk bin license --retrieve
After this:
yum works normally
Plesk updates complete
License activation succeeds
The “Repository is not opened” error is resolved
This is a workaround only.
CentOS 7 is end of life and will continue to cause issues.
Recommended long-term solution is migration to a supported OS such as:
AlmaLinux 8 or 9
CloudLinux 8