yum - epel源

背景

EPEL (Extra Packages for Enterprise Linux) 是Fedora小组维护的一个软件仓库项目,提供了官方源不支持的或者官方更新缓慢的包,很多开源软件需要用epel源进行安装,do it.

安装

1.查看已有源,sudo yum repolist

Loading mirror speeds from cached hostfile
 * epel: mirror.sjc02.svwh.net

2.卸载。如果已有epel 源但不可用并且问题不好定位,则执行yum -y remove epel-release卸载旧版

3.安装epel源

; centos7就选`latest-7`,同理6选latest-6
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

4.安装rpm

sudo yum install epel-release-latest-7.noarch.rpm

5.检查版本:

rpm -q epel-release

其他

  1. yum repo的路径为/etc/yum.repos.d
  2. epel.repo的文件内容如下,如果需要关闭某个源,则将配置文件中的enabled置为0
 [epel]
 name=Extra Packages for Enterprise Linux 7 - $basearch
 #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
 metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
 failovermethod=priority
 enabled=1
 gpgcheck=1
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

 [epel-debuginfo]
 name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
 #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug
 metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
 failovermethod=priority
 enabled=0
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
 gpgcheck=1

 [epel-source]
 name=Extra Packages for Enterprise Linux 7 - $basearch - Source
 #baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS
 metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
 failovermethod=priority
 enabled=0
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
 gpgcheck=1

你可能感兴趣的:(yum)