经常要给服务器增加epel源,这里记录一下,省得老是上网查epel的地址。
一、概述:
epel是一种yum仓库,里面提供了更多、更丰富的linux软件,但是,它不是默认的yum仓库,我们需要手工添加这个yum源。
以下就是添加这个yum源的方法:
二、开始添加epel yum源
epel源是fedora的软件计划,为此,我们可以登录任意一个fedora的镜像。
我们这里使用搜狐的镜像,http://mirrors.sohu.com
然后,找到fedora-epel,
http://mirrors.sohu.com/fedora-epel/
在列表里找到:6server,(这里指的是linux的发行版,具体,按照自己的情况来,是5.X,就找5,是6.X,就找6,比如,是6.Xserver系列等,就找6server)。
接着,从链接 http://mirrors.sohu.com/fedora-epel/6Server/ 进入,
继续根据自己的安装发行版选择,是i386还是X86_64,
我这里 选择的是X86_64,点击链接,就进入了:
http://mirrors.sohu.com/fedora-epel/6Server/x86_64/
接下来会列出很多软件,用浏览器搜一下epel,会找到一个
epel-release-6-8.noarch.rpm
复制该软件包的地址,然后用 wget下载它
[root@localhost ~]# wget http://mirrors.sohu.com/fedora-epel/6Server/x86_64/epel-release-6-8.noarch.rpm --2014-08-18 11:42:06-- http://mirrors.sohu.com/fedora-epel/6Server/x86_64/epel-release-6-8.noarch.rpm 正在解析主机 mirrors.sohu.com... 119.188.36.70 正在连接 mirrors.sohu.com|119.188.36.70|:80... 已连接。 已发出 HTTP 请求,正在等待回应... 200 OK 长度:14540 (14K) [application/x-redhat-package-manager] 正在保存至: “epel-release-6-8.noarch.rpm” 100%[============================================================>] 14,540 --.-K/s in 0.03s 2014-08-18 11:42:06 (426 KB/s) - 已保存 “epel-release-6-8.noarch.rpm” [14540/14540])
下载完毕,安装它:
[root@localhost ~]# yum localinstall epel-release-6-8.noarch.rpm Loaded plugins: fastestmirror, security Setting up Local Package Process Examining epel-release-6-8.noarch.rpm: epel-release-6-8.noarch Marking epel-release-6-8.noarch.rpm to be installed Loading mirror speeds from cached hostfile * base: mirrors.btte.net * extras: mirror.neu.edu.cn * updates: mirrors.btte.net base | 3.7 kB 00:00 extras | 3.4 kB 00:00 updates | 3.4 kB 00:00 Resolving Dependencies --> Running transaction check ---> Package epel-release.noarch 0:6-8 will be installed --> Finished Dependency Resolution Dependencies Resolved ====================================================================================================== Package Arch Version Repository Size ====================================================================================================== Installing: epel-release noarch 6-8 /epel-release-6-8.noarch 22 k Transaction Summary ====================================================================================================== Install 1 Package(s) Total size: 22 k Installed size: 22 k Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : epel-release-6-8.noarch 1/1 Verifying : epel-release-6-8.noarch 1/1 Installed: epel-release.noarch 0:6-8 Complete!
安装完毕,导入gpg-key
[root@localhost ~]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
然后,清空一下yum的缓存之类的
[root@localhost ~]# yum clean all Loaded plugins: fastestmirror, security Cleaning repos: base epel extras updates Cleaning up Everything Cleaning up list of fastest mirrors
再重建yum cache:
[root@localhost ~]# yum makecache Loaded plugins: fastestmirror, security Determining fastest mirrors epel/metalink | 5.1 kB 00:00 * base: mirrors.btte.net * epel: mirrors.neusoft.edu.cn * extras: mirror.bit.edu.cn * updates: mirrors.btte.net base | 3.7 kB 00:00 base/group_gz | 220 kB 00:00 base/filelists_db | 5.9 MB 00:01 base/primary_db | 4.4 MB 00:01 base/other_db | 2.8 MB 00:00 epel | 4.4 kB 00:00 epel/group_gz | 237 kB 00:00 epel/filelists_db | 9.0 MB 00:04 epel/primary_db | 6.3 MB 00:02 epel/other_db | 3.6 MB 00:01 epel/updateinfo | 841 kB 00:00 extras | 3.4 kB 00:00 extras/filelists_db | 11 kB 00:00 extras/prestodelta | 907 B 00:00 extras/primary_db | 19 kB 00:00 extras/other_db | 5.8 kB 00:00 updates | 3.4 kB 00:00 updates/filelists_db | 2.7 MB 00:00 updates/prestodelta | 434 kB 00:00 updates/primary_db | 4.7 MB 00:00 updates/other_db | 41 MB 00:06 Metadata Cache Created
可以看到,epel源已经加进来了。
我们可以尝试来下载属于epel仓库的软件,比如lrzsz
[root@localhost ~]# yum install lrzsz Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile * base: mirrors.btte.net * epel: mirrors.neusoft.edu.cn * extras: mirror.bit.edu.cn * updates: mirrors.btte.net Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package lrzsz.x86_64 0:0.12.20-27.1.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ====================================================================================================== Package Arch Version Repository Size ====================================================================================================== Installing: lrzsz x86_64 0.12.20-27.1.el6 base 71 k Transaction Summary ====================================================================================================== Install 1 Package(s) Total download size: 71 k Installed size: 159 k Is this ok [y/N]: y Downloading Packages: lrzsz-0.12.20-27.1.el6.x86_64.rpm | 71 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : lrzsz-0.12.20-27.1.el6.x86_64 1/1 Verifying : lrzsz-0.12.20-27.1.el6.x86_64 1/1 Installed: lrzsz.x86_64 0:0.12.20-27.1.el6 Complete!
好了,现在可以下载epel仓库的软件了。