解决CentOS 7停止更新支持后yum源失效的问题
最近CentOS 7已经停止更新支持,同时官方也把yum源删除了,目前CentOS 7系统使用yum命令安装软件包提示“Could not resolve host: mirrorlist.centos.org; Unknown error”,因此需要更换yum源。
在ssh界面执行以下命令即可更换yum源为CentOS的Vault源(包括CentOS官方和阿里云的源):
wget -O /etc/yum.repos.d/CentOS-Base.repo http://file.kangle.cccyun.cn/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://file.kangle.cccyun.cn/repo/epel-7.repo
或者:
curl -o /etc/yum.repos.d/CentOS-Base.repo http://file.kangle.cccyun.cn/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo http://file.kangle.cccyun.cn/repo/epel-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
免责声明
大圣导航网 - 学习技术从这里开始!提供的一切软件、教程和内容信息仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络收集整理,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑或手机中彻底删除上述内容。如果您喜欢该程序和内容,请支持正版,购买注册,得到更好的正版服务。我们非常重视版权问题,如有侵权请邮件9321856@qq.com与我们联系处理。敬请谅解!