國內yum源的安裝(163,阿里雲,epel)nginx
----阿里雲鏡像源centos
1、備份緩存
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backupcurl
2、下載新的CentOS-Base.repo 到/etc/yum.repos.d/post
CentOS 5阿里雲
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repourl
或者spa
curl -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
或者
curl -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
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3、以後運行 yum clean all,yum makecache 生成緩存
----163鏡像源
第一步:備份你的原鏡像文件,以避免出錯後能夠恢復。
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 第二步:下載新的CentOS-Base.repo 到/etc/yum.repos.d/
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS5-Base-163.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
3、以後運行 yum clean all,yum makecache 生成緩存
----EPEL源
EPEL(Extra Packages for Enterprise Linux)是由 Fedora 社區打造,爲 RHEL 及衍生髮行版如 CentOS等提供高質量軟件包的項目。裝上了 EPEL,就像在 Fedora 上同樣,能夠經過 yum install 軟件包名,便可安裝不少之前須要編譯安裝的軟件、經常使用的軟件或一些比較流行的軟件,好比如今流行的nginx、htop、ncdu、vnstat等等,均可以使用EPEL很方便的安裝更新。
目前能夠直接經過執行命令: yum install epel-release 直接進行安裝,若是此命令沒法安裝能夠嘗試如下方法
----安裝EPEL 阿里雲源
1、備份(若有配置其餘epel源)
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup
2、下載新repo 到/etc/yum.repos.d/
epel(RHEL 7)
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
epel(RHEL 6)
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
epel(RHEL 5)
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-5.repo
----官方源直接安裝
CentOS/RHEL 5 :
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm
CentOS/RHEL 6 :
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
CentOS/RHEL 7 :
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm