CentOS 7 Is Broken for Upgrade
In the last few year RedHat destroyed CentOS 7. Now we’ve moved on to Debian, Ubuntu, and Alma Linux.
If you have an old system, you’ll see a number of errors. The big clues are `yum update` fails and `yum upgrade` fails.
Step 1 – Fix the 404s.
Typically they start off with a 404. It’s a long hairy message about the repository configuration, but the top will look like this:
... http://mirror.centos.org/centos/7/sclo/x86_64/rh/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
or this:
... Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=genclo error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org"
They end list this:
Cannot find a valid baseurl for repo: base/7/x86_64
Replace the mirror lists:
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
Next yum upgrade again.
Step 2 – Fix invalid baseurl centos-sclo-sclo repo
You’ll see a big message again and at the bottom:
Cannot find a valid baseurl for repo: centos-sclo-sclo
Remove the broken repo:
mv /etc/yum.repos.d/CentOS-SCLo-scl.repo /etc/yum.repos.d/CentOS-SCLo-scl.disabled
Digital Ocean Trouble with icinga2-common
At Digital Ocean you may encounter this problem:
The GPG keys listed for the "ICINGA (stable release for epel)" repository are already installed but they are not correct for this package. Check that the correct key URLs are configured for this repository. Failing package is: icinga2-common-2.14.3-1.el7.x86_64 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ICINGA
The solution is:
rpm --import https://packages.icinga.com/icinga.key yum clean all yum makecache yum upgrade
Virtualmin unauthorized
failure: repodata/repomd.xml from virtualmin: [Errno 256] No more mirrors to try. https://5600280:[email protected]/vm/6/centos/7/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 401 - Unauthorized
You need to update your license or do this on a legacy system:
virtualmin downgrade-license --perform
Virtualmin package no signed fix
Package wbm-virtual-server-7.20.1.gpl-1.noarch.rpm is not signed
Upgrade so:
yum upgrade --nogpgcheck
You will cry at Stack
sqlite problems
Disable that bad repo
yum-config-manager --disable centos-sclo-rh yum-config-manager --disable centos-sclo-sclo
Maybe try this if it fails again:
yum remove sclo-php55-php-pecl-imagick
See also
Virtualmin doesn’t upgrade: How to fix invalid signature Virtualmin apt packages
2 thoughts on “CentOS is out of date – yum upgrade is failing – Fixes for yum update and yum upgrade”
virtualmin setup-repos did not change the contents of /etc/yum.repos.d/virtualmin.repo on my CentOS 7 (although the timestamp of the file changed) so I tried a manual update:
wget https://software.virtualmin.com/vm/7/rpm/virtualmin-gpl-release.noarch.rpm
rpm -Uvh virtualmin-gpl-release.noarch.rpm
warning: virtualmin-gpl-release.noarch.rpm: Header V4 RSA/SHA256 Signature, key ID b9a0b8b7: NOKEY
Preparing… ################################# [100%]
file /etc/pki/rpm-gpg/RPM-GPG-KEY-webmin from install of virtualmin-gpl-release-7.0-1.noarch conflicts with file from package virtualmin-release-6.0-3.gpl.noarch
file /etc/yum.repos.d/virtualmin.repo from install of virtualmin-gpl-release-7.0-1.noarch conflicts with file from package virtualmin-release-6.0-3.gpl.noarch
yum remove virtualmin-release-6.0-3.gpl.noarch
rpm -Uvh virtualmin-gpl-release.noarch.rpm
yum clean all
yum upgrade
Fix Centos 7 yum Error for update
Delete All Repos on Dir /etc/yum.repos.d
Then Create File CentOS-Base.repo
Copy And Paste Thi Text And Save It
[base]
name=CentOS-$releasever – Base
baseurl=https://vault.centos.org/7.9.2009/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
#released updates
[updates]
name=CentOS-$releasever – Updates
baseurl=https://vault.centos.org/7.9.2009/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
#additional packages that may be useful
[extras]
name=CentOS-$releasever – Extras
baseurl=https://vault.centos.org/7.9.2009/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever – CentosPlus
baseurl=https://vault.centos.org/7.9.2009/centosplus/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=0
then
yum clean all
yum update -y
its working