绿色小软件下载
当前位置:首页 >> 备忘笔记 >> 解决CentOS 7停止更新支持后yum源失效

解决CentOS 7停止更新支持后yum源失效

尼克莱斯·沃思 备忘笔记 22

最近CentOS 7已经停止更新支持,同时官方也把yum源删除了,目前CentOS 7系统使用yum命令安装软件包提示“Could not resolve host: mirrorlist.centos.org; Unknown error”,因此需要更换yum源。

解决CentOS 7停止更新支持后yum源失效

在ssh界面执行以下命令即可更换yum源为CentOS的Vault源(包括CentOS官方和阿里云的源):

wget -O /etc/yum.repos.d/CentOS-Base.repo :file.kangle.cccyun.cn/repo/Centos-7.repo

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo :file.kangle.cccyun.cn/repo/Centos-7.repo

解决CentOS Stream 8停止更新后无法使用yum命令。

在ssh界面执行以下命令即可更换yum源为CentOS的Vault源:

sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo

sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo

sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo

协助本站SEO优化一下,谢谢!
关键词不能为空

免责声明

本站有部分为网络搜集整理而来, 如有版权及内容质疑,请即刻联系站长整改。分享是美德,欢迎转载,敬请注明出处

同类推荐
控制面板
您好,欢迎到访网站!
  查看权限
标签列表