实验环境:

[root@bogon zhi]# uname -aLinux bogon 2.6.32-642.11.1.el6.i686 #1 SMP Fri Nov 18 18:48:28 UTC 2016 i686 i686 i386 GNU/Linux[root@bogon zhi]# cat /etc/redhat-release CentOS release 6.8 (Final)

一、安装Wget   

[root@bogon zhi]# yum install wget已加载插件:fastestmirror, refresh-packagekit设置安装进程Loading mirror speeds from cached hostfile * base: mirror.bit.edu.cn * epel: mirror.lzu.edu.cn * extras: mirrors.btte.net * updates: mirrors.btte.net解决依赖关系--> 执行事务检查---> Package wget.i686 0:1.12-8.el6 will be 安装--> 完成依赖关系计算依赖关系解决================================================================================================================================================================================= 软件包                                   架构                                     版本                                           仓库                                      大小=================================================================================================================================================================================正在安装: wget                                     i686                                     1.12-8.el6                                     base                                     483 k事务概要=================================================================================================================================================================================Install       1 Package(s)总下载量:483 kInstalled size: 1.8 M确定吗?[y/N]:y下载软件包:wget-1.12-8.el6.i686.rpm                                                                                                                                  | 483 kB     00:00     运行 rpm_check_debug 执行事务测试事务测试成功执行事务  正在安装   : wget-1.12-8.el6.i686                                                                                                                                          1/1   Verifying  : wget-1.12-8.el6.i686                                                                                                                                          1/1 已安装:  wget.i686 0:1.12-8.el6                                                                                                                                                         完毕!

 二、下载repel

  CentOS6.8_32位epel下载地址:https://mirrors.tuna.tsinghua.edu.cn/epel/6/i386/epel-release-6-8.noarch.rpm

  CentOS6.8_64位epel下载地址:https://mirrors.tuna.tsinghua.edu.cn/epel/6Server/x86_64/epel-release-6-8.noarch.rpm

[root@bogon zhi]# wget https://mirrors.tuna.tsinghua.edu.cn/epel/6/i386/epel-release-6-8.noarch.rpm--2016-12-06 01:44:43--  https://mirrors.tuna.tsinghua.edu.cn/epel/6/i386/epel-release-6-8.noarch.rpm正在解析主机 mirrors.tuna.tsinghua.edu.cn... 166.111.206.63, 2402:f000:1:416:166:111:206:63正在连接 mirrors.tuna.tsinghua.edu.cn|166.111.206.63|:443... 已连接。已发出 HTTP 请求,正在等待回应... 200 OK长度:14540 (14K) [application/x-redhat-package-manager]正在保存至: “epel-release-6-8.noarch.rpm.1”100%[=======================================================================================================================================>] 14,540      --.-K/s   in 0s      2016-12-06 01:44:43 (262 MB/s) - 已保存 “epel-release-6-8.noarch.rpm.1” [14540/14540])[root@bogon zhi]# lsDesktop  Documents  Downloads  epel-release-6-8.noarch.rpm  epel-release-6-8.noarch.rpm.1  Music  Pictures  Public  Templates  Videos

三、安装epel

[root@bogon zhi]# rpm -ivh epel-release-6-8.noarch.rpm                  #安装下载好的epel rpm包Preparing...                ########################################### [100%]        package epel-release-6-8.noarch is already installed[root@bogon zhi]# rpm -e epel-release-6-8.noarch.rpmerror: package epel-release-6-8.noarch.rpm is not installed[root@bogon zhi]# rpm -e epelerror: package epel is not installed[root@bogon zhi]# rpm -qa |grep  epelepel-release-6-8.noarch[root@bogon zhi]# rpm -e epel-release-6-8.noarch[root@bogon zhi]# rpm -ivh epel-release-6-8.noarch.rpmPreparing...                ########################################### [100%]   1:epel-release           ########################################### [100%][root@bogon zhi]# rpm -qa |grep epel                             #安装成功       epel-release-6-8.noarch[root@bogon zhi]# ll  /etc/yum.repos.d/                           #查看额外源   总用量 32-rw-r--r--. 1 root root 1991 5月  19 2016 CentOS-Base.repo-rw-r--r--. 1 root root  647 5月  19 2016 CentOS-Debuginfo.repo-rw-r--r--. 1 root root  289 5月  19 2016 CentOS-fasttrack.repo-rw-r--r--. 1 root root  630 5月  19 2016 CentOS-Media.repo-rw-r--r--. 1 root root 6259 5月  19 2016 CentOS-Vault.repo-rw-r--r--. 1 root root  957 11月  5 2012 epel.repo-rw-r--r--. 1 root root 1056 11月  5 2012 epel-testing.repo[root@bogon zhi]# cat  /etc/yum.repos.d/epel.repo [epel]name=Extra Packages for Enterprise Linux 6 - $basearch#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearchmirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearchfailovermethod=priorityenabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6[epel-debuginfo]name=Extra Packages for Enterprise Linux 6 - $basearch - Debug#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debugmirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearchfailovermethod=priorityenabled=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6gpgcheck=1[epel-source]name=Extra Packages for Enterprise Linux 6 - $basearch - Source#baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMSmirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearchfailovermethod=priorityenabled=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6gpgcheck=1