Héctor Oses
Héctor Oses

Reputation: 131

When using Centos 6, I cannot run 'yum update' anymore, I get this error 'Cannot find a valid baseurl for repo: base'

When using VirtualBox with a Centos6 image I cannot do yum udpate anymore, I have checked on the internet and it looks that Centos6 is deprecated.

[root@centos69 ~]# yum makecache
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror, refresh-packagekit, security
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

[root@centos69 ~]# yum update
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Update Process
Loading mirror speeds from cached hostfile
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

Upvotes: 3

Views: 12829

Answers (3)

Yoof Yoof
Yoof Yoof

Reputation: 21

followed this post and it worked. https://www.getpagespeed.com/server-setup/how-to-fix-yum-after-centos-6-went-eol The alternative method in the post:

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

and replace the content with this:

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

[C6.10-updates]
name=CentOS-6.10 - Updates
baseurl=http://vault.epel.cloud/6.10/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=1
metadata_expire=never

[C6.10-extras]
name=CentOS-6.10 - Extras
baseurl=http://vault.epel.cloud/6.10/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=1
metadata_expire=never

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

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

Upvotes: 2

lpaseen
lpaseen

Reputation: 1239

Yes, like red hat 6.x centos 6 did go EOL in november 2020, hope you don't have anything sensitive stuff in that vm. https://forums.centos.org/viewtopic.php?t=72710

You can change to use the vault at vault.centos.org. First you should disable any repo that no longer work. You can get a list of repos with

yum repolist

then you can disable them with

yum-config-manager --disable  {reponame} {reponame}

like

yum-config-manager --disable  base update

or just disable all of them

yum-config-manager |grep ^\\[|tr -d ']['|xargs yum-config-manager --disable

Once the broken repos are disabled you need to add the vault repo.

yum-config-manager --add-repo=https://vault.centos.org/6.10/os/x86_64/

After that you can install packages as needed but remember - it's no updates to anything so if security is a concern you need to change os to something newer that is supported.

Upvotes: 3

Héctor Oses
Héctor Oses

Reputation: 131

There could be two possible solutions to solve this issue:

  1. Edit the CentOS-Base.repo file with vim
vim /etc/yum.repos.d/CentOS-Base.repo

Delete or comment every line that starts with 'mirrorlist'.

And add the following line to every [section] of the file like [base], [updates]...

baseurl=https://vault.centos.org/6.10/os/$basearch/
  1. Another solution could be running this command on an image that comes from this repo https://vault.centos.org/
/scripts/autorepair centos6_base_repo_is_no_more

More information about these solutions:  

https://support.cpanel.net/hc/en-us/articles/360058490254--CentOS-6-End-of-Life-Notice  

https://forums.cpanel.net/threads/yumrepo-error-and-cannot-find-valid-baseurl.682465/

Upvotes: 6

Related Questions