YumRepo Error: All mirror URLs are not using ftp, http[s] or file.

Cause of the problem: It may be that the default mirror site cannot be accessed normally
insert image description here

Problem solved: try changing the default mirror site

Ali's mirror site is recommended here

  1. Backup local mirror site
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
  1. Download the new CentOS-Base.repo to /etc/yum.repos.d/
    centos8 (the official source of centos8 has been offline, it is recommended to switch the source of centos-vault)
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

or

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

CentOS 6

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-6.repo

or

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-6.repo

CentOS 7

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

or

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

3. Clean up yum data and update the cache

yum clean all
yum makecache 

Guess you like

Origin blog.csdn.net/weixin_46220576/article/details/123228824