CentOS使用epel yum源

我们用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

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 《只管去做》是我看的时间管理专家邹小强老师的第二本书,第一本是《小强升职记》。巧合的是,这两本书都是在岁末年初...
    Eva伊伊阅读 3,532评论 0 4
  • 曾经在一个论坛上看到一个帖子,是让大家晒出自己最幸福的照片,其中有一个人晒了很多她女友的照片,很多生活的点点滴滴,...
    白衣伯阅读 2,958评论 0 0