CentOS使用epel yum源

作者: Alan_Xu94 | 来源:发表于2018-03-27 14:37 被阅读4次

我们用yum安装软件时,经常发现我们的yum源里面没有该软件,需要自己去wget,然后configure,make,make install,太折腾了。

其实,CentOS还有一个源叫做 EPEL (Extra Packages for Enterprise),里面有1万多个软件,比163的源还强,强烈建议安装。

1.安装之前首先来看目前的yum源(建议先配置一个国内的yum源(163/aliyun等))

[root@localhost ~]# yum repolist

已加载插件:fastestmirror

Loading mirror speeds from cached hostfile

* epel: mirrors.tuna.tsinghua.edu.cn

仓库标识            仓库名称                                                  状态

base                CentOS-6 - Base - 163.com                                  6,706

extras              CentOS-6 - Extras - 163.com                                    53

updates              CentOS-6 - Updates - 163.com                                1,177

repolist: 20,402

2、安装EPEL YUM源

yum install epel-release

安装完成之后,会在/etc/yum.repo.d/ 目录下生成两个yum源的repo文件:

epel.repo  #正式版,所有的软件都是稳定可以信赖的

epel-testing.repo #测试版,使用时需要慎重但是默认情况下,只有正式版是有效状态的,如果想试试测试版的话,需要修改/etc/yum.repos.d/epel-testing.repo,把enabled=0改成enabled=1即可

3.生成缓存

[root@localhost ~]# yum makecache

已加载插件:fastestmirror

Loading mirror speeds from cached hostfile

epel/metalink                                                  | 5.5 kB    00:00   

* epel: mirrors.tuna.tsinghua.edu.cn

base                                                          | 3.7 kB    00:00   

epel/group_gz                                                  | 255 kB    00:00   

epel/filelists_db                                              | 7.9 MB    00:00   

epel/updateinfo                                                | 774 kB    00:00   

epel/prestodelta                                              |  423 B    00:00   

epel/other_db                                                  | 3.0 MB    00:00   

extras                                                        | 3.4 kB    00:00   

updates                                                        | 3.4 kB    00:00   

元数据缓存已建立

4.检验yum源有没有安装成功

[root@localhost ~]# yum repolist

已加载插件:fastestmirror

Loading mirror speeds from cached hostfile

* epel: mirrors.tuna.tsinghua.edu.cn

仓库标识            仓库名称                                                  状态

base                CentOS-6 - Base - 163.com                                  6,706

epel                Extra Packages for Enterprise Linux 6 - x86_64            12,466

extras              CentOS-6 - Extras - 163.com                                    53

updates              CentOS-6 - Updates - 163.com                                1,177

repolist: 20,402

相关文章

网友评论

    本文标题:CentOS使用epel yum源

    本文链接:https://www.haomeiwen.com/subject/edxscftx.html