具体原因:使用yum搜索某些rpm包,找不到包是因为CentOS是RedHat企业版编译过来的,去掉了所有关于版权问题的东西。安装EPEL后可以很好的解决这个问题。EPEL(Extra Packages for Enterprise Linux )即企业版Linux的扩展包,提供了很多可共Centos使用的组件,安装完这个以后基本常用的rpm都可以找到。
Method #1从企业版Linux库配置包中安装扩展包。(推荐 )
[root@localhost~]#sudoyuminstallepel-release Loadedplugins:fastestmirror,langpacks Loadingmirrorspeedsfromcachedhostfile ResolvingDependencies -->Runningtransactioncheck --->Packageepel-release.noarch0:7-5willbeinstalled -->FinishedDependencyResolution DependenciesResolved ================================================================================ PackageArchVersionRepositorySize ================================================================================ Installing: epel-releasenoarch7-5extras14k TransactionSummary ================================================================================ Install1Package Totaldownloadsize:14k Installedsize:24k Isthisok[y/d/N]:y Downloadingpackages: epel-release-7-5.noarch.rpm|14kB00:01 Runningtransactioncheck Runningtransactiontest Transactiontestsucceeded Runningtransaction Installing:epel-release-7-5.noarch1/1 Verifying:epel-release-7-5.noarch1/1 Installed: epel-release.noarch0:7-5 Complete!
Method #2 从dl.fedoraproject.org安装扩展包。
1.使用wget命令下载epel-release:
[root@localhost~]#cd/tmp [root@localhost~]#wgethttps://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpmls*.rpm
或者通过wiki查找到对应版本的epel后,再下载:
[root@localhost~]#wgethttp://dl.fedoraproject.org/pub/epel/7/x86_64/epel-release-7-5.noarch.rpm 或 [root@localhost~]#wgethttp://mirrors.ustc.edu.cn/fedora/epel/7/x86_64/epel-release-7-5.noarch.rpm//中国科学技术大学镜像
2.安装:
[root@localhost~]#sudoyuminstallepel-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身份执行)
原文链接:https://www.f2er.com/bash/390853.html