标签:
国内开源镜像站有:
网易: http://mirrors.163.com/
搜狐: http://mirrors.sohu.com/
阿里云: http://mirrors.aliyun.com/
北京理工大学,北京交通大学等等
centos/rhel(访问http://mirrors.163.com/,找到“centos使用帮助”的链接,可以看到相关说明)
①备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
②下载对应的repo文件到/etc/yum.repos.d/,并稍作修改.
http://mirrors.163.com/.help/CentOS7-Base-163.repo
http://mirrors.163.com/.help/CentOS6-Base-163.repo //centos6
http://mirrors.163.com/.help/CentOS5-Base-163.repo
cd /etc/yum.repos.d/
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
sed -i ‘s#$releasever#6#‘ CentOS6-Base-163.repo
③清理并重新生成yum缓存
yum clean all
yum makecache
ubantu (访问http://mirrors.163.com/,找到“ubuntu使用帮助”的链接,可以看到相关说明)
①备份
mv /etc/apt/sources.list /etc/apt/sources.list.bak
②下载对应的list文件到/etc/apt/ ,其中trusty是版本的代号.
http://mirrors.163.com/.help/sources.list.lucid lucid(10.04)
http://mirrors.163.com/.help/sources.list.precise precise(12.04)
http://mirrors.163.com/.help/sources.list.trusty trusty(14.04)
http://mirrors.163.com/.help/sources.list.utopic utopic(14.10)
http://mirrors.163.com/.help/sources.list.vivid vivid(15.04)
http://mirrors.163.com/.help/sources.list.wily wily(15.10)
③重新生成缓存
apt-get update
标签:
原文地址:http://www.cnblogs.com/assassin1994/p/4699653.html