centos 7/rhel7: 如何安装EPEL软件库

在centos 7 或者rhel 7系统上如何安装 EPEL repo呢? 使用EPEL repo 可以用来很容易的安装不同的软件包或者第三方的软件包。这些软件包在centos 或者RHEL官方的yum软件库里是不支持的。所以我们可以通过安装EPEL 软件库来安装官方不支持的软件包。
安装EPEL 软件库
1.首先下载并安装epel安装包,使用下面的命令:
[cc lang=”php”]
yum install epel-release-7-2.noarch.rpm
[/cc]
命令输出:
[cc lang=”php”]
Loaded plugins: amazon-id, rhui-lb
Examining epel-release-7-2.noarch.rpm: epel-release-7-2.noarch
Marking epel-release-7-2.noarch.rpm to be installed
Resolving Dependencies
–> Running transaction check
—> Package epel-release.noarch 0:7-2 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
epel-release noarch 7-2 /epel-release-7-2.noarch 22 k
Transaction Summary
================================================================================
Install 1 Package
Total size: 22 k
Installed size: 22 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : epel-release-7-2.noarch 1/1
Verifying : epel-release-7-2.noarch 1/1
Installed:
epel-release.noarch 0:7-2
[/cc]
Complete!
当你安装完毕后可以使用“yum repolist” 命令来显示epel repo:
[cc lang=”php”]
yum repolist
[/cc]
命令输出:
[cc lang=”php”]
Loaded plugins: amazon-id, rhui-lb
repo id repo name status
epel/x86_64 Extra Packages for Enterprise Linux 7 – x86_64 5,610
rhui-REGION-client-config-server-7/x86_64 Red Hat Update Infrastructure 2.0 Client Configur 2
rhui-REGION-rhel-server-releases/7Server/x86_64 Red Hat Enterprise Linux Server 7 (RPMs) 4,718
repolist: 10,330
[/cc]
查找并安装软件包
使用下面的命令来显示在epel repo 里的所有可用软件包:
[cc lang=”php”]
$ sudo yum –disablerepo=”*” –enablerepo=”epel” list available
[/cc]
或者:
[cc lang=”php”]
$ sudo yum –disablerepo=”*” –enablerepo=”epel” list available | grep ‘package’
[/cc]

Leave a Reply