0

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
Héctor Oses
  • 71
  • 1
  • 10

3 Answers3

4

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/

Héctor Oses
  • 71
  • 1
  • 10
  • can u please elaborate more about "/scripts/autorepair centos6_base_repo_is_no_more" - how to run this cmd. ( I am getting script not found error). thanks – SaddamBinSyed May 18 '21 at 14:51
  • This script is only available for the Centos 6 official images that come from this repo https://vault.centos.org/. If you download Centos 6 from another repo, that image may not contain that script. – Héctor Oses May 19 '21 at 09:09
  • Thanks for the reply. FYI. I am using Cloudera sdh 5.13 version. centos6.7. I have tried your first solution but still, the YUM update failing with a 404 found error. and sometimes authentication failed error. if u have any idea about this, pls share it here. – SaddamBinSyed May 19 '21 at 09:34
  • There should not be a problem making the configuration I just posted, just use sudo, check you have internet connection... If you have any problems use the other two links provided. Check other similar posts for other versions of Centos to see how they do it and compare it to my solution. Maybe there is a recent modification in the base url, etc. Calm down and troubleshoot, it should not be that hard, trust me. – Héctor Oses May 19 '21 at 10:09
2

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.

lpaseen
  • 1,189
  • 8
  • 8
0

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