Centos 6 repo EOL fix

Centos 6 support has ended on November 30th 2020

When you run ‘yum update’ you get the following errors.

Loaded plugins: fastestmirror, security
Setting up Update Process
Determining fastest mirrors
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/repo/arch combination/
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base

  1. vim /etc/yum.repos.d/CentOS-Base.repo
  2. and comment out(put #) on all ‘mirrorlist’ and then uncomment (take out #) on all baseurl then replace the URL (official centos.org, do not use 3rd parties, they are dangerous) as following on all ‘baseurl’ lines

    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra

    baseurl=https://vault.centos.org/6/os/$basearch/

You are all set.

Leave a Comment