由于部分包仅存在于epel源中,所以我们在centos中添加;
以下提供了2种方法,1手动,2自动
1、手动方法
vi/etc/yum.repos.d/epel.repo
添加以下代码
[epel] name=ExtraPackagesforEnterpriseLinux7-$basearch #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch failovermethod=priority enabled=1 gpgcheck=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 [epel-debuginfo] name=ExtraPackagesforEnterpriseLinux7-$basearch-Debug #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug mirrorlist=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=ExtraPackagesforEnterpriseLinux7-$basearch-Source #baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS mirrorlist=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缓存
yummakecache
查看yum源
yumrepolist Loadedplugins:fastestmirror Loadingmirrorspeedsfromcachedhostfile *base:mirrors.zju.edu.cn *epel:mirror01.idc.hinet.net *extras:mirrors.zju.edu.cn *updates:mirrors.zju.edu.cn repoidreponamestatus base/7/x86_64CentOS-7-Base9,007 *epel/x86_64ExtraPackagesforEnterpriseLinux7-x86_6410,547 extras/7/x86_64CentOS-7-Extras377 updates/7/x86_64CentOS-7-Updates2,311 repolist:22,242
2、自动方法
安装epel源
yuminstall-yepel-release
查看yum源
yumrepolist Loadedplugins:fastestmirror epel/x86_64/metalink|5.4kB00:00:00 epel|4.3kB00:00:00 (1/3):epel/x86_64/group_gz|170kB00:00:00 (2/3):epel/x86_64/updateinfo|622kB00:00:01 (3/3):epel/x86_64/primary_db|4.2MB00:00:06 Loadingmirrorspeedsfromcachedhostfile *base:mirrors.aliyun.com *epel:mirror01.idc.hinet.net *extras:mirrors.cn99.com *updates:centos.ustc.edu.cn repoidreponamestatus base/7/x86_64CentOS-7-Base9,007 epel/x86_64ExtraPackagesforEnterpriseLinux7-x86_6410,548 extras/7/x86_64CentOS-7-Extras377 updates/7/x86_64CentOS-7-Updates2,243
这两种方法都可以,可能第一种采用了国外源对部分用户不适用.
在我这边,这两种区别不大.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。