今天像往常一样打开xshell远程连接CentOS服务器,打算装一个小软件,键入yum install -y XXXX之后,竟然提示

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 retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

顿时有些懵逼,上网搜索了半天才知道CentOS6停止维护更新日期为2020年11月30日,也就是说官方关闭了下载镜像源,需要使用aliyun的镜像。可以依次输入以下命令完成操作:

1.sed -i "s|enabled=1|enabled=0|g" /etc/yum/pluginconf.d/fastestmirror.conf

2.mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

3.curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Aliyun.repo

4.yum clean all

5.yum makecache

即可。

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐