一、安装EPEL源:

# wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
# rpm -ivh epel-release-7-5.noarch.rpm

验证查看是否安装成功:
yum repolist


查看某个包的详细信息:
yum --enablerepo=epel info htop

列出epel源的所有包列表:
yum --disablerepo="*" --enablerepo="epel" list available | less

附:
1、RHEL/CentOS 6.x的EPEL源安装方法:

## RHEL/CentOS 6 64-Bit ##

# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm

2、RHEL/CentOS 5.x的EPEL源安装方法:

## RHEL/CentOS 5 64-Bit ##

# wget http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
# rpm -ivh epel-release-5-4.noarch.rpm

二、安装remi源:
注意:安装REMI库不要在启用了REMI库时运行yum update。因为REMI库的包名与RHEL/CentOS默认库中的相同,运行yum update可能会触发意外的更新。平时禁用REMI库,在你需要安装RMEI库中独有的包时再启用。安装REMI库之前,首先需要启用EPEL库,因为REMI中的一些包依赖于EPEL。

安装步骤:
在CentOS 7上:

# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
# rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi

在CentOS 6上:

# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
# rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi

默认REMI是禁用的。要搜索或安装REMI仓库中的包,使用这些命令:

# yum --enablerepo=remi search php-fpm
# yum --enablerepo=remi install php-fpm