Press "Enter" to skip to content

Redhat 7配置EPEL源

第一种方法:
[root@test yum.repos.d]# wget http://mirrors.aliyun.com/repo/Centos-7.repo
--2018-05-16 14:36:38-- http://mirrors.aliyun.com/repo/Centos-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 39.106.237.110, 39.106.237.115, 39.106.237.113, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|39.106.237.110|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2573 (2.5K) [application/octet-stream]
Saving to: ‘Centos-7.repo’

100%[=============================================================================================================================================================================>] 2,573 --.-K/s in 0s

2018-05-16 14:36:38 (291 MB/s) - ‘Centos-7.repo’ saved [2573/2573]

[root@test yum.repos.d]# ll
total 20
-rw-r--r-- 1 root root 2573 Nov 21 2014 Centos-7.repo
[root@test yum.repos.d]# yum clean all
[root@test yum.repos.d]# yum repolist all
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
repo id repo name status
base/7/x86_64 CentOS-7 - Base - mirrors.aliyun.com enabled: 9,911
centosplus/7/x86_64 CentOS-7 - Plus - mirrors.aliyun.com disabled
contrib/7/x86_64 CentOS-7 - Contrib - mirrors.aliyun.com disabled
extras/7/x86_64 CentOS-7 - Extras - mirrors.aliyun.com enabled: 213
updates/7/x86_64 CentOS-7 - Updates - mirrors.aliyun.com enabled: 143
repolist: 10,267
[root@test ~]# yum list|grep epel-release
epel-release.noarch 7-11 epel
[root@test yum.repos.d]# yum install -y epel-release.noarch
[root@test yum.repos.d]# rpm -qa|grep epel
epel-release-7-11.noarch
说明安装成功.

第二种方法:
[root@test yum.repos.d]# wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo
--2018-05-16 14:54:55-- http://mirrors.aliyun.com/repo/epel-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 39.106.237.108, 39.106.237.109, 39.106.237.114, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|39.106.237.108|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 664 [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/epel-7.repo’

100%[=============================================================================================================================================================================>] 664 --.-K/s in 0s

2018-05-16 14:54:55 (120 MB/s) - ‘/etc/yum.repos.d/epel-7.repo’ saved [664/664]
[root@test yum.repos.d]# ll
total 24
-rw-r--r-- 1 root root 664 May 11 11:35 epel-7.repo
[root@test yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: epel
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
Cleaning up list of fastest mirrors
[root@test yum.repos.d]# yum repolist all
Loaded plugins: fastestmirror
epel | 4.7 kB 00:00:00
(1/3): epel/x86_64/group_gz | 84 kB 00:00:00
(2/3): epel/x86_64/updateinfo | 922 kB 00:00:00
(3/3): epel/x86_64/primary_db | 6.4 MB 00:00:00
Determining fastest mirrors
repo id repo name status
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 enabled: 12,538
epel-debuginfo/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 - Debug disabled
epel-source Extra Packages for Enterprise Linux 7 - x86_64 - Source disabled
repolist: 12,538

Be First to Comment

发表评论

电子邮件地址不会被公开。 必填项已用*标注