centos换源的方法 centos修改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/
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3、清理后运行生成缓存
yum clean all
yum update
yum makecache
国内源:
网易:http://mirrors.163.com/.help/CentOS6-Base-163.repo
中科大:http://centos.ustc.edu.cn/CentOS-Base.repo
搜狐:http://mirrors.sohu.com/help/CentOS-Base-sohu.repo
顶(0)
踩(0)
- 最新评论
