在CentOS和RHEL上安装EPEL源

EPEL(Extra Packages for Enterprise Linux) 是由Fedora社区创建和维护的第三方软件源,含有大量涉及网络、系统管理、程序开发和系统监控等内容的高质量的开源软件包,对于RHEL及其兼容的Linux发行版如CentOS的官方源来说是个很好的补充。安装好EPEL源之后,就可以通过yum命令安装数千个EPEL软件包。

安装EPEL软件源之前,首先要确认系统的版本。

# cat /etc/redhat-release
CentOS release 6.3 (Final)

然后使用以下命令,根据系统版本安装相应的EPEL软件源。注:同一个安装包可以在32位或者64位系统上安装。

RHEL/CentOS 6 :
# wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# rpm -Uvh epel-release-6-8.noarch.rpm
RHEL/CentOS 5 :
# wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
# rpm -Uvh epel-release-5-4.noarch.rpm

验证安装:

# yum repolist

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
repo id repo name status
base CentOS-6 - Base 6,381
epel Extra Packages for Enterprise Linux 6 - x86_64 9,295
extras CentOS-6 - Extras 13
updates CentOS-6 - Updates 1,017
repolist: 22,560

使用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。
(完)


除非注明,科威网文章均为原创。转载请以链接形式标明本文地址。
本文地址:https://quenywell.com/set-up-epel-repository-on-rhel-centos/

Comment (1)

  1. Pingback: 在CentOS 6上安装Linux版Skype | 科威网

Leave a Comment

您的电子邮箱地址不会被公开。 必填项已用 * 标注