1. Home
  2. Servers
  3. How to manually fix the base repository on EOL CentOS 6 to enable package installation via yum

How to manually fix the base repository on EOL CentOS 6 to enable package installation via yum

This Article will show you How to manually fix the base repository on EOL CentOS 6 to enable package installation via yum

Step 1. Login to the server via SSH as the root user, or open the Terminal from WHM as the root user

Step 2. Move your existing repository out of the way so that you can revert the changes if necessary:

mv -v /etc/yum.repos.d/CentOS-Base.repo{,-backup}

Step 3. Create a new empty repository file: 

touch /etc/yum.repos.d/CentOS-Base.repo

Step 4. Open this newly created file with the text editor of your choice

Step 5. Paste the following configuration into the file:

[base]
name=CentOS-$releasever - Base
baseurl=http://vault.centos.org/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=1
metadata_expire=never


[updates]
name=CentOS-$releasever - Updates
baseurl=http://vault.centos.org/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=1
metadata_expire=never


[extras]
name=CentOS-$releasever - Extras
baseurl=http://vault.centos.org/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=1
metadata_expire=never


[contrib]
name=CentOS-$releasever - Contrib
baseurl=http://vault.centos.org/$releasever/contrib/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0
metadata_expire=never


[centosplus]
name=CentOS-$releasever - CentOSPlus
baseurl=http://vault.centos.org/$releasever/centosplus/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0
 metadata_expire=never

Step 6. Clear the yum cache and then remake it:

yum clean all

yum makecache

yum update

Please note that this will NOT provide your server with updates to fix defects or security vulnerabilities as is mentioned earlier in this article

Updated on October 19, 2023

Was this article helpful?

Related Articles

Leave a Comment