CentOS 配置使用第三方IUS库

在kernel.org内,清楚地说明了IUS项目是干什么的:

IUS is a community project that provides RPM packages for newer versions of select software for Enterprise Linux distributions.
 
Project Goals
   Create high quality RPM packages for Red Hat Enterprise Linux (RHEL) and CentOS.
   Promptly release updated RPM packages once new versions are released by the upstream developers.
   No automatic replacement of stock RPM packages.

IUS只为RHEL和CentOS这两个发行版提供较新版本的rpm包。如果在os或epel找不到某个软件的新版rpm,软件官方又只提供源代码包的时候,可以来ius源中找,几乎都能找到。例如haproxy,在CentOS 6的epel中只有1.5版本的,但ius中却提供了1.6和1.7版本。
IUS源的站点根目录:https://dl.iuscommunity.org/pub/ius/。
IUS提供4个分支的rpm包:stable、archive、development和testing。显然,我们应该选择stable分支的包。

配置IUS源:

RedHat 安装方法:
rpm -ivh https://rhel5.iuscommunity.org/ius-release.rpm     # RHEL 5
rpm -ivh https://rhel6.iuscommunity.org/ius-release.rpm     # RHEL 6
rpm -ivh https://rhel7.iuscommunity.org/ius-release.rpm     # RHEL 7
CentOS 安装方法:
rpm -ivh https://centos5.iuscommunity.org/ius-release.rpm   # CentOS 5
rpm -ivh https://centos6.iuscommunity.org/ius-release.rpm   # CentOS 6
rpm -ivh https://centos7.iuscommunity.org/ius-release.rpm   # CentOS 7

rpm安装ius-release.rpm时,依赖于epel。所以必须先安装epel源。注意,这是包的依赖关系,因此必须是安装了epel,而不是仅仅在repo文件中配置了epel源。

# yum -y install epel-release