奔著裝nginx 安裝 yum 的一些記錄
之前在aliyun的ECS上 直接可以看到nginx

在新服務(wù)器上查看發(fā)現(xiàn)沒(méi)有nginx包,使用provides */nginx 查看本地的yum源中是edu的懷疑是yum源中沒(méi)有,

按照如下方式命令更換aliyun的yum源


EPEL源
EPEL(Extra Packages for Enterprise Linux)是由?Fedora?社區(qū)打造,為?RHEL?及衍生發(fā)行版如?CentOS等提供高質(zhì)量軟件包的項(xiàng)目。裝上了EPEL,就像在?Fedora?上一樣,可以通過(guò)?yum install?軟件包名,即可安裝很多以前需要編譯安裝的軟件、常用的軟件或一些比較流行的軟件,比如現(xiàn)在流行的nginx、htop、ncdu、vnstat等等,都可以使用EPEL很方便的安裝更新。

yum安裝
1.刪除原有的yum
rpm -aq|grep yum|xargs rpm -e --nodeps
2.下載安裝包
Centos6
?wget http://mirrors.aliyun.com/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.*
? wget http://mirrors.aliyun.com/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm
?wget http://mirrors.aliyun.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
?wget http://mirrors.aliyun.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm
? ? wget http://mirrors.aliyun.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
Centos7
wget http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-3.4.3-161.el7.centos.noarch.rpm
wget http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm
wget http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
3.安裝yum包
rpm -ivh *.rpm
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
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
curl -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 https://qst123.oss-cn-beijing.aliyuncs.com/SETUP/repo/CentOS-Base.repo
后邊這個(gè)為阿里云內(nèi)網(wǎng)
wegt -O 也可以
3、 yum clean all && yum makecache?緩存
epel安裝
yum install epel-release
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
curl -o /etc/yum.repos.d/epel.repo?https://qst123.oss-cn-beijing.aliyuncs.com/SETUP/repo/epel.repo