具体原因:使用yum搜索某些rpm包,找不到包是因为CentOS是RedHat企业版编译过来的,去掉了所有关于版权问题的东西。安装EPEL后可以很好的解决这个问题。EPEL(Extra Packages for Enterprise Linux )即企业版Linux的扩展包,提供了很多可共Centos使用的组件,安装完这个以后基本常用的rpm都可以找到。
Method #1 从企业版Linux库配置包中安装扩展包。(推荐 )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
[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:
1
2
|
[root@localhost ~]
# cd/tmp
[root@localhost ~]
# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm ls*.rpm
|
或者通过wiki查找到对应版本的epel后,再下载:
1
2
3
|
[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.安装:
1
|
[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身份执行)
本文转自浅景尘51CTO博客,原文链接:http://blog.51cto.com/857803451/1964363 ,如需转载请自行联系原作者