一、什么是EPEL?
二、CentOS 6.X 安装163 YUM源
三、CentOS 6.X 安装使用EPEL YUM源(推荐)
四、卸载EPEL源
注:操作系统 CentOS 6.X
用163的YUM源,因为是国内的YUM源,比较快,但也有很多rpm包没有,所以不推荐。(假如不能连接国外网络,就使用163 yum源;假如能访问国外网络,就使用epel yum源。)
一、什么是EPEL?
EPEL,即Extra Packages for Enterprise Linux(http://fedoraproject.org/wiki/EPEL) 是由 Fedora 社区打造,为 RHEL 及衍生发行版如 CentOS、Scientific Linux 等提供高质量软件包的项目。在这里可以获得 RHEL 的高质量、高性能、高可靠性、免费、方便易用的软件包。
二、CentOS 6.X 安装163 YUM源
1.查看系统版本
[root@sht-sgmhadoopdn-01 ~]# cd /etc/yum.repos.d/
[root@sht-sgmhadoopdn-01 yum.repos.d]# lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.5 (Final)
Release: 6.5
Codename: Final
You have mail in /var/spool/mail/root
[root@sht-sgmhadoopdn-01 yum.repos.d]# cat /etc/issue
CentOS release 6.5 (Final)
Kernel \r on an \m
2.备份/etc/yum.repos.d/CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
3.下载对应版本repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份)
[root@sht-sgmhadoopdn-01 yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
--2016-12-11 16:21:03-- http://mirrors.163.com/.help/CentOS6-Base-163.repo
Resolving mirrors.163.com... 123.58.173.186, 123.58.173.185
Connecting to mirrors.163.com|123.58.173.186|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2006 (2.0K) [application/octet-stream]
Saving to: “CentOS6-Base-163.repo”
100%[==========================================================================================================================>] 2,006 --.-K/s in 0s
2016-12-11 16:21:04 (239 MB/s) - “CentOS6-Base-163.repo” saved [2006/2006]
[root@sht-sgmhadoopdn-01 yum.repos.d]# ll
total 12
-rw-r--r-- 1 root root 2006 Sep 18 2014 CentOS6-Base-163.repo
-rw-r--r-- 1 root root 133 Dec 3 09:34 cloudera-manager.repo
-rw-r--r-- 1 root root 129 Nov 25 18:10 cloudera-manager.repo.~1~
4.重新生成缓存
[root@sht-sgmhadoopdn-01 yum.repos.d]# yum clear all
[root@sht-sgmhadoopdn-01 yum.repos.d]# yum makecache
三、CentOS 6.X 安装使用EPEL YUM源(推荐)
1. 查看操作系统版本
[root@sht-sgmhadoopdn-02 ~]# cd /etc/yum.repos.d/
[root@sht-sgmhadoopdn-02 yum.repos.d]# ll
total 12
-rw-r--r-- 1 root root 2006 Nov 25 19:34 CentOS6-Base.repo.bak
-rw-r--r-- 1 root root 133 Dec 3 08:52 cloudera-manager.repo
-rw-r--r-- 1 root root 129 Nov 25 18:11 cloudera-manager.repo.~1~
[root@sht-sgmhadoopdn-02 yum.repos.d]# uname -a
Linux sht-sgmhadoopdn-02 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@sht-sgmhadoopdn-02 yum.repos.d]# cat /etc/issue
CentOS release 6.5 (Final)
Kernel \r on an \m
2.下载相应的EPEL源
[root@sht-sgmhadoopdn-02 yum.repos.d]# wget http://mirrors.hust.edu.cn/epel//6/x86_64/epel-release-6-8.noarch.rpm
--2016-12-11 16:25:19-- http://mirrors.hust.edu.cn/epel//6/x86_64/epel-release-6-8.noarch.rpm
Resolving mirrors.hust.edu.cn... 202.114.18.160
Connecting to mirrors.hust.edu.cn|202.114.18.160|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14540 (14K) [application/x-redhat-package-manager]
Saving to: “epel-release-6-8.noarch.rpm”
100%[==========================================================================================================================>] 14,540 67.9K/s in 0.2s
2016-12-11 16:25:22 (67.9 KB/s) - “epel-release-6-8.noarch.rpm” saved [14540/14540]
3.安装EPEL源(注:我这里是64位系统)
[root@sht-sgmhadoopdn-02 yum.repos.d]# rpm -ivh epel-release-6-8.noarch.rpm
Preparing... ########################################### [100%]
1:epel-release ########################################### [100%]
4.导入key文件
[root@sht-sgmhadoopdn-02 yum.repos.d]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
6.重新生成缓存
[root@sht-sgmhadoopdn-02 yum.repos.d]# yum clean all
[root@sht-sgmhadoopdn-02 yum.repos.d]# yum makecache
[root@sht-sgmhadoopdn-02 yum.repos.d]#
四、卸载EPEL源
[root@sht-sgmhadoopdn-02 yum.repos.d]# rpm -e epel-release
说明:如果你暂时不想使用EPEL的yum源的话,把对应文件里的enabled=1改成enabled=0就行了,如果你完全不需要了,那就直接卸载掉
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。