Claim your Biolink Click Here
1 like 0 dislike
595 views
Centos 6
in Education & Reference by (4.7k points) | 595 views

1 Answer

0 like 0 dislike

When trying update CentOS 6 with the yum update command getting an error:

Loaded plugins: fastestmirror, refresh-packagekit, 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

Cause

CentOS 6 reached the end of life on the 30th of November 2020. YUM attempting to connect to deprecated repositories. So, we need to update deprecated repositories URLs and point to the vault.

Resolution

To fix this problem you edit /etc/yum.repos.d/CentOS-Base.repo and replace all mirrorlist

  1. Go to /etc/yum.repos.d/ directory:

cd /etc/yum.repos.d/

  1. Make copy of original file:

cp CentOS-Base.repo CentOS-Base.repo.old

  1. Open and edit file with any text editor:

vi CentOS-Base.repo

  1. Replace mirror lists

Replace sections:

[base] [updates]
[extras]

With following:

[base]
name=CentOS-$releasever - Base

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

baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/

baseurl=https://vault.centos.org/6.10/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

released updates

[updates]
name=CentOS-$releasever - Updates

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

baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/

baseurl=https://vault.centos.org/6.10/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

additional packages that may be useful

[extras]
name=CentOS-$releasever - Extras

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

baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/

baseurl=https://vault.centos.org/6.10/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

  1. Clean yum cache

yum clean all

  1. Run again yum update command:

yum update

Now you can successfully update your CentOS 6.

by (820 points)

Related questions

0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
2 like 0 dislike
1 answer
2 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

1,310 questions
1,471 answers
569 comments
4,809 users