How to fix YumRepo Error and Cannot find valid baseurl

When you try to update or install any software inside your centos 6/7 you might will see the following issues

YumRepo Error and Cannot find valid baseurl

To fix this issue you need to login to your server using ssh software such as putty

Problem

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 of this error here is not an issue with your OS but the EOL of using this linux template has reached to the end of the life

 

So we are going to update the links inside SSH

 

The Solution:

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/

2. Make copy of original file:

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

3. Open and edit file with any text editor:

# vi CentOS-Base.repo

4. Replace mirrorlist‘s

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

5. Clean yum cache

# yum clean all

6. Run again yum update command:

# yum update

Now you can successfully update your CentOS 6.

  • 16 Users Found This Useful
Was this answer helpful?

Related Articles

How to Empty / Delete files .trash folder cPanel users

The .trash folder in /home/$username/.trash contains any files that a user has deleted via their...

How to fix cPanel 500 internal server error

How to fix cPanel 500 internal server errorYou need to run the following command in SSH to fix...

How to install WordPress Toolkit inside cPanel/WHM

The WordPress Toolkit interface allows you to easily install, configure, and manage WordPress®....

How to install let's encrypt cpanel/WHM

We are here to guide to let you know how to install the let's encrypt plugin inside cpanel/whm...

How to enable mod_suexec with Apache on cPanel

If your server requires that you run websites as the user’s account, run the following command to...