Linux快速配置epel源——Centos-7

本文指导如何备份Linux本地源并详细介绍了在CentOS 7上下载和安装EPEL源的步骤,包括使用163的repo更新缓存。

备份linux本地源到新文件中:

[root@localhost yum.repos.d]# pwd
/etc/yum.repos.d
[root@localhost yum.repos.d]# mkdir Centos
[root@localhost yum.repos.d]# ls
163.repo.bak   CentOS-Base.repo       CentOS-fasttrack.repo  CentOS-Vault.repo
Centos         CentOS-CR.repo         CentOS-Media.repo
Centos-7.repo  CentOS-Debuginfo.repo  CentOS-Sources.repo
[root@localhost yum.repos.d]# mv * Centos
mv: 无法将目录"Centos" 移动至自身的子目录"Centos/Centos" 下
[root@localhost yum.repos.d]# ls
Centos

下载Centos-7的源,到该文件下(使用163的repo):

附带:

163开源地址

163-Centos开源地址

[root@localhost yum.repos.d]# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
--2018-09-27 11:17:41--  http://mirrors.163.com/.help/CentOS7-Base-163.repo
正在解析主机 mirrors.163.com (mirrors.163.com)... 59.111.0.251
正在连接 mirrors.163.com (mirrors.163.com)|59.111.0.251|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:1572 (1.5K) [application/octet-stream]
正在保存至: “CentOS7-Base-163.repo”

100%[=================================================>] 1,572       --.-K/s 用时 0s      

2018-09-27 11:17:41 (122 MB/s) - 已保存 “CentOS7-Base-163.repo” [1572/1572])

[root@localhost yum.repos.d]# ls
Centos  CentOS7-Base-163.repo

更新缓存:

[root@localhost yum.repos.d]# yum clean all 
已加载插件:fastestmirror, langpacks
正在清理软件源: base extras updates
Cleaning up everything
Cleaning up list of fastest mirrors
[root@localhost yum.repos.d]# yum list 
...... 
yum-rhn-plugin.noarch                         2.0.1-10.el7                        base     
yum-updateonboot.noarch                       1.1.31-46.el7_5                     updates  
yum-utils.noarch                              1.1.31-46.el7_5                     updates  
zenity.x86_64                                 3.22.0-1.el7                        base     
zip.x86_64                                    3.0-11.el7                          base     
zlib.i686                                     1.2.7-17.el7                        base     
zlib.x86_64                                   1.2.7-17.el7                        base     
zlib-devel.i686                               1.2.7-17.el7                        base     
zlib-devel.x86_64                             1.2.7-17.el7                        base     
zlib-static.i686                              1.2.7-17.el7                        base     
zlib-static.x86_64                            1.2.7-17.el7                        base     
zsh.x86_64                                    5.0.2-28.el7                        base     
zsh-html.x86_64                               5.0.2-28.el7                        base     
zziplib.i686                                  0.13.62-5.el7                       base     
zziplib.x86_64                                0.13.62-5.el7                       base     
zziplib-devel.i686                            0.13.62-5.el7                       base     
zziplib-devel.x86_64                          0.13.62-5.el7                       base     
zziplib-utils.x86_64                          0.13.62-5.el7                       base     

安装epel源:

[root@localhost yum.repos.d]# yum install -y epel-release
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
正在解决依赖关系
--> 正在检查事务
---> 软件包 epel-release.noarch.0.7-11 将被 安装
--> 解决依赖关系完成

依赖关系解决

===========================================================================================
 Package                   架构                版本              源                   大小
===========================================================================================
正在安装:
 epel-release              noarch              7-11              extras               15 k

事务概要
===========================================================================================
安装  1 软件包

总下载量:15 k
安装大小:24 k
Downloading packages:
epel-release-7-11.noarch.rpm                                        |  15 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : epel-release-7-11.noarch                                               1/1 
  验证中      : epel-release-7-11.noarch                                               1/1 

已安装:
  epel-release.noarch 0:7-11                                                               

完毕!
[root@localhost yum.repos.d]# ls
Centos  CentOS7-Base-163.repo  epel.repo  epel-testing.repo

完成!

yum repolist all Repository extras is listed more than once in the configuration Repository extras is listed more than once in the configuration Repository centosplus is listed more than once in the configuration Repository PowerTools is listed more than once in the configuration Repository AppStream is listed more than once in the configuration repo id repo name status AppStream CentOS-8 - AppStream - repo.huaweicloud.com enabled BaseOS CentOS-8 - Base - repo.huaweicloud.com enabled PowerTools CentOS-8 - PowerTools - repo.huaweicloud.com enabled appstream CentOS Linux 8 - AppStream disabled appstream-source CentOS Linux 8 - AppStream - Source disabled base CentOS-8.5.2111 - Base - mirrors.aliyun.com enabled baseos CentOS Linux 8 - BaseOS disabled baseos-source CentOS Linux 8 - BaseOS - Source disabled centosplus CentOS-8 - Plus - repo.huaweicloud.com disabled cr CentOS Linux 8 - ContinuousRelease disabled debuginfo CentOS Linux 8 - Debuginfo disabled devel CentOS Linux 8 - Devel WARNING! FOR BUILDROOT USE ONLY! disabled epel Extra Packages for Enterprise Linux 8 - x86_64 enabled epel-debuginfo Extra Packages for Enterprise Linux 8 - x86_64 - Debug disabled epel-modular Extra Packages for Enterprise Linux Modular 8 - x86_64 - RETIRED disabled epel-modular-debuginfo Extra Packages for Enterprise Linux Modular 8 - x86_64 - Debug - RETIRED disabled epel-modular-source Extra Packages for Enterprise Linux Modular 8 - x86_64 - Source - RETIRED disabled epel-source Extra Packages for Enterprise Linux 8 - x86_64 - Source disabled epel-testing Extra Packages for Enterprise Linux 8 - Testing - x86_64 disabled epel-testing-debuginfo Extra Packages for Enterprise Linux 8 - Testing - x86_64 - Debug disabled epel-testing-modular Extra Packages for Enterprise Linux Modular 8 - Testing - x86_64 - RETIRED disabled epel-testing-modular-debuginfo Extra Packages for Enterprise Linux Modular 8 - Testing - x86_64 - Debug - RETIRED disabled epel-testing-modular-source Extra Packages for Enterprise Linux Modular 8 - Testing - x86_64 - Source - RETIRED disabled epel-testing-source Extra Packages for Enterprise Linux 8 - Testing - x86_64 - Source disabled extras CentOS-8 - Extras - repo.huaweicloud.com enabled extras-source CentOS Linux 8 - Extras - Source disabled fasttrack CentOS Linux 8 - FastTrack disabled ha CentOS Linux 8 - HighAvailability disabled media-appstream CentOS Linux 8 - Media - AppStream disabled media-baseos CentOS Linux 8 - Media - BaseOS disabled plus CentOS Linux 8 - Plus disabled plus-source CentOS Linux 8 - Plus - Source disabled powertools CentOS Linux 8 - PowerTools disabled powertools-source CentOS Linux 8 - PowerTools - Source disabled
06-11
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值