我是靠谱客的博主 俊逸可乐,这篇文章主要介绍Centos6无法使用yum,错误提示为:Error: Cannot find a valid baseurl for repo: base,现在分享给大家,希望可以做个参考。

在Centos6上执行yum -y install lrzsz命令,出现以下报错信息:

Loaded plugins: fastestmirror, security
Setting up Install 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
[root@localhost network-scripts]#  yum list
Loaded plugins: fastestmirror, security
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

原因为:

CentOS 6已经随着2020年11月的结束进入了EOL(Reaches End of Life),不过有一些老设备依然需要支持,CentOS官方也给这些还不想把CentOS 6扔进垃圾堆的用户保留了最后一个版本的镜像,只是这个镜像不会再有更新了。简单来说就是官方已经抛弃了这个镜像。

 

解决方案:

更换源,更换的Vault源推荐有两个,一个是官方的http://vault.centos.org,使用的北美AWS的服务器,海外的话使用这个就可以;还有一个是阿里的http://mirrors.aliyun.com/centos-vault/,国内使用这个不会卡。

 

解决命令如下:

在Centos6上依次执行以下命令:

复制代码
1
2
3
4
5
sed -i "s|enabled=1|enabled=0|g" /etc/yum/pluginconf.d/fastestmirror.conf mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Aliyun.repo yum clean all yum makecache

执行完以上命令后可正常安装lrzsz

最后

以上就是俊逸可乐最近收集整理的关于Centos6无法使用yum,错误提示为:Error: Cannot find a valid baseurl for repo: base的全部内容,更多相关Centos6无法使用yum,错误提示为:Error:内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(64)

评论列表共有 0 条评论

立即
投稿
返回
顶部