CentOS 第三方 YUM 源与镜像站整理
1.最简单的方法
yum install yum-fastestmirror
yum clean all
yum install epel-release
#安装好yum-fastestmirror后,每次用yum安装就会自动检查速度最快的镜像了
2.换成网易(min安装先安装 yum wget)
-
下载 repo
1 | wget http: //mirrors .163.com/.help /CentOS6-Base-163 .repo |
-
替换 repo
1 2 3 | cd /etc/yum .repos.d/ mv CentOS-Base.repo CentOS-Base.repo.bak mv CentOS6-Base-163.repo CentOS-Base.repo |
-
更新 cache
1 2 | yum clean all yum makecache |
-
Verify
1 2 3 4 5 6 7 8 | [root@localhost tmp] # yum repolist Loaded plugins: fastestmirror, refresh-packagekit, security Loading mirror speeds from cached hostfile repo id repo name status base CentOS-6 - Base - 163.com 6,367 extras CentOS-6 - Extras - 163.com 14 updates CentOS-6 - Updates - 163.com 463 repolist: 6,844 |
运行yum makecache生成缓存 http://mirrors.163.com/.help/centos.html
转:
#CentOS-Base.repo其他版本文件在http://mirrors.163.com/.help查看
1、 cd /etc/yum.repos.d
2、 wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
3、替换CentOS-Base.repos
4、yum update 即可。很简单-------------------------------------
# cd /etc/yum.repos.d/ 进入到yum仓库
# mv CentOS-Base.repo CentOS-Base.repo.bak 将系统自带的备份下
# wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo 下载一个新的yum源
# yum clean all 清空缓存
注:
rhel6
# cd /etc/yum.repos.d/
# mv local.repo local.repo.bak
# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
# vim CentOS6-Base-163.repo -- 将$releasever全部改为6
# yum clean all
# yum makecache
rhel5
# cd /etc/yum.repos.d/
# mv local.repo local.repo.bak
# wget http://mirrors.163.com/.help/CentOS5-Base-163.repo
# vim CentOS5-Base-163.repo -- 将$releasever全部改为5
# yum clean all
# yum makecache
/etc/redhat-release
uname –a
yum install yum-plugin-fastestmirror
yum install -y yum-priorities
yum clean all
EPEL 源
https://fedoraproject.org/wiki/EPEL/zh-cn
yum install epel-release
Remi 源
http://rpms.remirepo.net/su -
cd /etc/yum.repos.d
wget https://rpms.remirepo.net/enterprise/remi.repoELRepo
http://elrepo.org/
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
镜像站
https://mirrors.tuna.tsinghua.edu.cn/
https://opsx.alibaba.com/mirror
http://mirrors.163.com/
https://wiki.centos.org/AdditionalResources/Repositories