Symptoms
When attempting to update, yum returns the following error on CentOS 5 systems:
Error: Cannot find a valid baseurl for repo: base
Description
CentOS has shut down the main servers hosting updates for CentOS 5, as the CentOS project no longer supports that version.
You will need to migrate your system to use the archive repositories to update your system. We strongly suggest migrating to a new server after you complete this guide, as we no longer provide updates on CentOS 5 systems.
Workaround
You will need to manually update the repository URLs for your server.
First, determine the architecture of your system.
# arch
This will return either i386 or x86-64.
Now, backup your old repository list.
# cp -avi /etc/yum.repos.d/CentOS-Base.repo{,.bak}
Then, modify the repository list accordingly.
# nano /etc/yum.repos.d/CentOS-Base.repo
For i386:
[base]
name=CentOS-$releasever - Base
baseurl=http://vault.centos.org/5.11/os/i386/
gpgcheck=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
priority=1
protect=1
#released updates
[update]
name=CentOS-$releasever - Updates
baseurl=http://vault.centos.org/5.11/updates/i386/
gpgcheck=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
priority=1
protect=1
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://vault.centos.org/5.11/extras/i386/
gpgcheck=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
priority=1
protect=1
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://vault.centos.org/5.11/centosplus/i386/
gpgcheck=0
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
priority=2
protect=1
For x86_64:
[base]
name=CentOS-$releasever - Base
baseurl=http://vault.centos.org/5.11/os/x86_64/
gpgcheck=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
priority=1
protect=1
#released updates
[update]
name=CentOS-$releasever - Updates
baseurl=http://vault.centos.org/5.11/updates/x86_64/
gpgcheck=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
priority=1
protect=1
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://vault.centos.org/5.11/extras/x86_64/
gpgcheck=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
priority=1
protect=1
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://vault.centos.org/5.11/centosplus/x86_64/
gpgcheck=0
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
priority=2
protect=1
Finally, flush the cached yum data from your system.
# yum clean all
You can now attempt to update.
Comments
0 comments
Article is closed for comments.