Enabling Centos Sources on XCP-Ng With CentOS 7 EOL
Note: I work for Forward Systems, a Vates Partner that helps clients deploy and manage infrastructure. If you need support on deployment projects, don’t hesitate to get in touch: https://fwdsystems.tech
Note: This is a follow-up on our previous article re. enabling SR encryption on XCP-ng: Enabling Data at Rest Encryption on XCP-Ng Hypervisors With a Fully LUKS and TPM Encrypted SR
Centos 7 repos don’t resolve (anymore)
As mentioned in our previous article, XCP-ng’s dom0 runs on CentOS 7.
Centos 7 reached its end-of-life (EOL) on June 30, 2024. While this may seem concerning, it’s not an issue as the Vates team maintains critical packages through a dedicated repository, ensuring that you continue receiving necessary patches.
However, one key change is that it’s no longer possible to install packages directly from the CentOS repository, as we did in the previous article. Attempting to do so will result in an error similar to the following:
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Name or service not known"
This is happening because when Centos 7 went EOL, repositories moved to https://vault.centos.org
.
The fix
To resolve our issue, you need to edit your sources under /etc/yum.repos.d/CentOS-Base.repo
as follows:
[base]
name=CentOS-$releasever - Base
baseurl=http://vault.centos.org/centos/$releasever/os/$basearch/
enabled=0
exclude=kernel kernel-abi-whitelists kernel-debug kernel-debug-devel kernel-devel kernel-doc kernel-tools kernel-tools-libs kernel-tools-libs-devel linux-firmware biosdevname centos-release systemd* stunnel kexec-tools ocaml*
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://vault.centos.org/centos/$releasever/updates/$basearch/
enabled=0
exclude=kernel kernel-abi-whitelists kernel-debug kernel-debug-devel kernel-devel kernel-doc kernel-tools kernel-tools-libs kernel-tools-libs-devel linux-firmware biosdevname centos-release systemd* stunnel kexec-tools ocaml*
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://vault.centos.org/centos/$releasever/extras/$basearch/
enabled=0
exclude=ocaml*
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://vault.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
With this adjustment, the rest of the instructions from our previous article remain valid and should work as intended.
Cheers!