centos 6 yum源不可用安装报YumRepo Error: All mirror URLs are not using ftp, http[s] or file

centos6 ping外网能通yum无法用原因 ,

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


解决方案

为了解决这个问题,我们需要修改/etc/yum.repos.d/CentOS-Base.repo,然后替换掉所有镜像源。


1.进入到 /etc/yum.repos.d/目录


cd /etc/yum.repos.d/


2.备份原文件


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


3.编辑新文件


vi CentOS-Base.repo


4.替换掉镜像源

# CentOS-Base.repo

#

# The mirror system uses the connecting IP address of the client and the

# update status of each mirror to pick mirrors that are updated to and

# geographically close to the client.  You should use this for CentOS updates

# unless you are manually picking other mirrors.

#

# If the mirrorlist= does not work for you, as a fall back you can try the

# remarked out baseurl= line instead.

#

#


[os]

name=Qcloud centos os - $basearch

baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/os/$basearch/

enabled=1

gpgcheck=1

gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-6


[updates]

name=Qcloud centos updates - $basearch

baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/updates/$basearch/

enabled=1

gpgcheck=1

gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-6


[centosplus]

name=Qcloud centosplus - $basearch

baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/centosplus/$basearch/

enabled=0

gpgcheck=1

gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-6


[contrib]

name=Qcloud centos contrib - $basearch

baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/contrib/$basearch/

enabled=0

gpgcheck=1

gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-6


[cr]

name=Qcloud centos cr - $basearch

baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/cr/$basearch/

enabled=0

gpgcheck=1

gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-6


[extras]

name=Qcloud centos extras - $basearch

baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/extras/$basearch/

enabled=1

gpgcheck=1

gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-6


[fasttrack]

name=Qcloud centos fasttrack - $basearch

baseurl=http://mirrors.cloud.tencent.com/centos/$releasever/fasttrack/$basearch/

enabled=0

gpgcheck=1

gpgkey=http://mirrors.cloud.tencent.com/centos/RPM-GPG-KEY-CentOS-6




.清理yum缓存

yum clean all

.yum makecache


问题解决啦!

原因

CentOS 6 于2020年11月30日停止维护,而Yum想要连接旧版本的仓库。所以,我们需要更新陈旧版本的仓库然后指向vault。


linux能ping通外网火狐浏览器打不开网页,这个原因换一个HTTP看,估计是HTTPS原因。 

centos 6 yum源不可用安装报错 centos6 外网能通yum无法用原因 linux能ping通外网火狐浏览器打不开网页

正如错误提示,https连接的公钥私钥创建不成立,加密通道创建失败无法连接。你ping的时候能成功应该用的是http协议。




发表评论 已发布 0

还可以输入 800 个字
看不清?点击更换
 
 
评论 打印