博主呓语:

CentOS/RHEL Linux安装EPEL第三方软件源

Posted by 破冰 on 2015-12-14 18:07 Monday

    EPEL(Extra Packages for Enterprise Linux) 是由 Fedora 社区打造,为 RHEL 及衍生发行版如 CentOS等提供高质量软件包的项目。装上了 EPEL,就像在 Fedora 上一样,可以通过 yum install 软件包名,即可安装很多以前需要编译安装的软件、常用的软件或一些比较流行的软件,比如现在流行的nginx, openvpn等等,都可以使用EPEL很方便的安装更新。

 根据你的系统版本安装,cat /etc/issue 可显示当前操作系统版本,

安装EPEL源:
CentOS/RHEL 5 :
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm
rpm -ivh epel-release-latest-5.noarch.rpm


CentOS/RHEL 6 :
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -ivh epel-release-latest-6.noarch.rpm

CentOS/RHEL 7 :
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm


导入key:
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

如果用比较新的软件,用epel-test.repo这个文件就行了

安装yum源优先级插件:
yum install yum-priorities

验证查看是否安装成功:yum repolist
yum repolist
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: centos.ustc.edu.cn
 * epel: mirror.premi.st
 * extras: centos.ustc.edu.cn
 * updates: centos.ustc.edu.cn
repo id                                           repo name                                                                                status
base                                              CentOS-6 - Base                                                                           6,575
epel                                              Extra Packages for Enterprise Linux 6 - x86_64                                           11,814
extras                                            CentOS-6 - Extras                                                                            46
updates                                           CentOS-6 - Updates                                                                          707
repolist: 19,142

 

使用EPEL源:
安装好源之后,就可以通过yum命令搜索和安装EPEL软件包。以安装XScreenSaver为例:

在EPEL源中查找XScreenSaver:

# yum --enablerepo=epel info xscreensaver
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.hustunique.com
* epel: mirrors.hust.edu.cn
* extras: mirrors.hustunique.com
* updates: www.quenywell.com
Available Packages
Name : xscreensaver
Arch : x86_64
Epoch : 1
Version : 5.11
Release : 7.el6.respin1
Size : 30 k
Repo : epel
Summary : X screen saver and locker
URL : http://www.jwz.org/xscreensaver/
License : MIT
Description : A modular screen saver and locker for the X Window System.
: More than 200 display modes are included in this package.
:
: This is a metapackage for installing all default packages
: related to XscreenSaver.

安装XScreenSaver:

# yum install xscreensaver

禁用EPEL源:

# vi /etc/yum.repos.d/epel.repo

将enabled=1选项改为enabled=0。

 

 

标签:

发表评论: