具體原因:使用yum搜索某些rpm包,找不到包是因爲CentOS是RedHat企業版編譯過來的,去掉了所有關於版權問題的東西。安裝EPEL後可以很好的解決這個問題。EPEL(Extra Packages for Enterprise Linux )即企業版Linux的擴展包,提供了很多可共Centos使用的組件,安裝完這個以後基本常用的rpm都可以找到。
Method #1 從企業版Linux庫配置包中安裝擴展包。(推薦 )
[root@localhost ~]# sudo yum install epel-release Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile Resolving Dependencies --> Running transaction check ---> Package epel-release.noarch 0:7-5 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: epel-release noarch 7-5 extras 14 k Transaction Summary ================================================================================ Install 1 Package Total download size: 14 k Installed size: 24 k Is this ok [y/d/N]: y Downloading packages: epel-release-7-5.noarch.rpm | 14 kB 00:01 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : epel-release-7-5.noarch 1/1 Verifying : epel-release-7-5.noarch 1/1 Installed: epel-release.noarch 0:7-5 Complete!
Method #2 從dl.fedoraproject.org安裝擴展包。
1.使用wget命令下載epel-release:
[root@localhost ~]# cd/tmp [root@localhost ~]# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm ls*.rpm
或者通過wiki查找到對應版本的epel後,再下載:
[root@localhost ~]# wget http://dl.fedoraproject.org/pub/epel/7/x86_64/epel-release-7-5.noarch.rpm 或 [root@localhost ~]# wget http://mirrors.ustc.edu.cn/fedora/epel/7/x86_64/epel-release-7-5.noarch.rpm //中國科學技術大學鏡像
2.安裝:
[root@localhost ~]# sudo yum install epel-release-7.noarch.rpm
注意:
1. epel的版本要與centos的版本相對應,否則安裝失敗,即centos7版本要對應epel7版本。
2. rpm安裝完後,rpm -ql epel*,確提示未安裝,此時要導入rpm的簽名信息
#rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 (root身份執行)