上一篇 下一篇 分享链接 返回 返回顶部

替换linux系统yum源

发布人:小亿 发布时间:20小时前 阅读量:8

在下载yum文件慢的情况下,可以更换DNS或更换yum源

1、备份系统旧配置文件

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

2、获取对应版本的CentOS-Base.repo 到/etc/yum.repos.d/目录
替换之前先备份旧配置

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

centos各版本的源配置列表
centos5

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos5_base.repo

centos6

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos6_base.repo

centos7(腾讯yum源)

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo

centos7(阿里云yum源)

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

更新缓存

yum clean all
yum makecache
目录结构
全文
小程序 小程序
企业微信 企业微信
服务热线: 0878-3101203
电子邮箱: yihwlkj@163.com