手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

CentOS 8 换源设置dnf/yum镜像

[日期:2019-10-30] 来源:Linux公社  作者:Linux [字体: ]

CentOS 8 默认是会读取centos.org的mirrorlist的,所以一般来说是不需要配置镜像的。

如果你的网络访问centos.org的mirrorlist有问题,可能才需要另外配置镜像

CentOS 8 换源设置dnf/yum镜像

cd /etc/yum.repos.d
#备份
cp CentOS-Base.repo CentOS-Base.repo.bak
cp CentOS-AppStream.repo CentOS-AppStream.repo.bak
cp CentOS-Extras.repo CentOS-Extras.repo.bak

sed -i 's/mirrorlist=/#mirrorlist=/g' CentOS-Base.repo CentOS-AppStream.repo CentOS-Extras.repo
sed -i 's/#baseurl=/baseurl=/g' CentOS-Base.repo CentOS-AppStream.repo CentOS-Extras.repo
sed -i 's/http:\/\/mirror.centos.org/https:\/\/mirrors.aliyun.com/g' CentOS-Base.repo CentOS-AppStream.repo CentOS-Extras.repo

Linux公社的RSS地址https://www.linuxidc.com/rssFeed.aspx

本文永久更新链接地址https://www.linuxidc.com/Linux/2019-10/161212.htm

linux
相关资讯       CentOS 8 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款