前言:epel源为“红帽系”的操作系统提供的额外的软件包,适用于RHEL,CentOS,

在安装ansible和其他软件时。会使用到epel源。

在安装epel源之前,首先安装一个叫:epel-release的软件包,这个软件包会自动配置yum仓库。

好,废话不多说,下面开始配置epel源

1.移除系统自带的yum仓库

[root@www82 ~]# cd /etc/yum.repos.d/   ###进入到yum仓库的目录[root@www82 yum.repos.d]# ls        #####发现系统自带的yum仓库,创建个bak目录,把系统自带地yum 仓库,全部移地bak目录中
bak               CentOS-CR.repo         CentOS-fasttrack.repo  CentOS-Sources.repo  rhe17.repo
CentOS-Base.repo  CentOS-Debuginfo.repo  CentOS-Media.repo      CentOS-Vault.repo[root@www82 yum.repos.d]# mv C* bak/    ######把系统自带地yum仓库,全部移地bak目录中[root@www82 yum.repos.d]# ls   ######在查看,只保留一个自己配的yum源,
bak  rhe17.repo

2.到阿里开源镜像中下载相应的repo文件,注意:此操作需要联网,需要把网卡的网关和DNS设置好,此操作需要用到wget软件包,没有的直接:yum  -y  install  wget去安装

[root@www82 yum.repos.d]# wget http://mirrors.aliyun.com/repo/Centos-7.repo#####下载repo文件,下面的是下载过程
--2021-08-10 06:20:48--  http://mirrors.aliyun.com/repo/Centos-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 111.6.227.173, 111.6.234.239, 111.6.227.174, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|111.6.227.173|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2523 (2.5K) [application/octet-stream]
Saving to: ‘Centos-7.repo’100%[============================================================================================================>] 2,523       --.-K/s   in 0s
2021-08-10 06:20:48 (359 MB/s) - ‘Centos-7.repo’ saved [2523/2523]   [root@www82 yum.repos.d]# ls   ###再次查看,发现已经下载Centos-7.repo文件,
bak  Centos-7.repo  rhe17.repo[root@www82 yum.repos.d]# mv rhe17.repo bak/    ###把自己配的本地yum源,也移动到bak目录中,
[root@www82 yum.repos.d]# ls    ######只保留刚才下载的repo文件
bak  Centos-7.repo

3.清楚缓存,重新生成缓存

[root@www82 yum.repos.d]# yum clean all    ###清楚缓存[root@www82 yum.repos.d]# yum makecache   ###生成缓存

4.安装epel源

[root@www82 yum.repos.d]#  yum install -y epel-release   ###下载epel源
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be installed
--> Finished Dependency ResolutionDependencies Resolved======================================================================================================================================================
......   ###此处省略                                            Installed:epel-release.noarch 0:7-11                                                                                                                          Complete!  ###下载完成[root@www82 yum.repos.d]# ls   ###在此查看又多出来两个repo文件
bak  Centos-7.repo  epel.repo  epel-testing.repo

5.使用阿里开源镜像提供的epel源

[root@www82 yum.repos.d]# wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo    ###下载epelyum源
--2021-08-10 06:34:45--  http://mirrors.aliyun.com/repo/epel-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 111.6.234.240, 111.6.252.118, 111.6.252.115, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|111.6.234.240|: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      2021-08-10 06:34:45 (92.1 MB/s) - ‘/etc/yum.repos.d/epel-7.repo’ saved [664/664][root@www82 yum.repos.d]# ls     ###在查看又多一个repo文件
bak  Centos-7.repo  epel-7.repo  epel.repo  epel-testing.repo

6.清除缓存,重新生成缓存

[root@www82 yum.repos.d]# yum clean all    ###清除缓存
Loaded plugins: fastestmirror
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
Cleaning repos: base epel extras updates
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@www82 yum.repos.d]# yum makecache    ###生成缓存
Loaded plugins: fastestmirror
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
Determining fastest mirrors* base: mirrors.aliyun.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
base                                                                                                                           | 3.6 kB  00:00:00
epel                                                                                                                           | 4.7 kB  00:00:00
extras                                                                                                                         | 2.9 kB  00:00:00
updates                                                                                                                        | 2.9 kB  00:00:00
(1/16): base/7/x86_64/group_gz                                                                                                 | 153 kB  00:00:00
(2/16): base/7/x86_64/filelists_db                                                                                             | 7.2 MB  00:00:03
(3/16): base/7/x86_64/primary_db                                                                                               | 6.1 MB  00:00:02
(4/16): epel/x86_64/group_gz                                                                                                   |  96 kB  00:00:00
(5/16): epel/x86_64/updateinfo                                                                                                 | 1.0 MB  00:00:00
(6/16): epel/x86_64/prestodelta                                                                                                | 2.8 kB  00:00:00
(7/16): base/7/x86_64/other_db                                                                                                 | 2.6 MB  00:00:01
(8/16): epel/x86_64/primary_db                                                                                                 | 6.9 MB  00:00:03
(9/16): extras/7/x86_64/primary_db                                                                                             | 242 kB  00:00:00
(10/16): extras/7/x86_64/filelists_db                                                                                          | 235 kB  00:00:00
(11/16): extras/7/x86_64/other_db                                                                                              | 143 kB  00:00:00
(12/16): epel/x86_64/other_db                                                                                                  | 3.4 MB  00:00:02
(13/16): updates/7/x86_64/filelists_db                                                                                         | 5.5 MB  00:00:03
(14/16): updates/7/x86_64/other_db                                                                                             | 688 kB  00:00:00
(15/16): updates/7/x86_64/primary_db                                                                                           | 9.6 MB  00:00:05
(16/16): epel/x86_64/filelists_db                                                                                              |  12 MB  00:00:09
Metadata Cache Created

7.测试epel源------>安装ansible,nginx

[root@www82 yum.repos.d]# yum install -y ansible    ###安装ansible
Loaded plugins: fastestmirror
Repository epel is listed more than once in the configuration
Repository epel-debuginfo is listed more than once in the configuration
Repository epel-source is listed more than once in the configuration
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package ansible.noarch 0:2.9.23-1.el7 will be installed...... 此处省略
Installed:ansible.noarch 0:2.9.23-1.el7                                                                                                                     Dependency Installed:PyYAML.x86_64 0:3.10-11.el7               libyaml.x86_64 0:0.1.4-11.el7_0                                python-babel.noarch 0:0.9.6-8.el7        python-backports.x86_64 0:1.0-8.el7       python-backports-ssl_match_hostname.noarch 0:3.5.0.1-1.el7     python-cffi.x86_64 0:1.6.0-5.el7         python-enum34.noarch 0:1.0.4-1.el7        python-idna.noarch 0:2.4-1.el7                                 python-ipaddress.noarch 0:1.0.16-2.el7   python-jinja2.noarch 0:2.7.2-4.el7        python-markupsafe.x86_64 0:0.11-10.el7                         python-paramiko.noarch 0:2.1.1-9.el7     python-ply.noarch 0:3.4-11.el7            python-pycparser.noarch 0:2.14-1.el7                           python-setuptools.noarch 0:0.9.8-7.el7   python-six.noarch 0:1.9.0-2.el7           python2-cryptography.x86_64 0:1.7.2-2.el7                      python2-httplib2.noarch 0:0.18.1-3.el7   python2-jmespath.noarch 0:0.9.4-2.el7     python2-pyasn1.noarch 0:0.1.9-7.el7                            sshpass.x86_64 0:1.06-2.el7              Complete!   ######完成安装,说明epel源可用

centos7配置epel源,如此简单!相关推荐

  1. RHEL / CentOS 配置epel源

    epel 是什么? epel的全称叫 Extra Packages for Enterprise Linux. EPEL 是由 Fedora 社区打造,为 RHEL 及衍生发行版如 CentOS.Sc ...

  2. Centos7配置yum源(本地yum源和阿里网络yum源)

    一.centos7配置yum源 yum源分为本地yum源和网络yum源 1.配置本地yum源 步骤一:在centos虚拟机中挂载光盘 1.创建挂载点目录 [root@localhost ~]# mkd ...

  3. linux 配置EPEL源

    配置EPEL源 [root@ansible ~]# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.no ...

  4. centos7:配置yum源,阿里源和本地源,并配置中文

    将阿里源作为yum源 # 首先检测wget是否已安装,如果未安装通过 yum install -y wget安装wget# 接着将原始yum源环境文件替换,通过重命名/etc/yum.repos.d/ ...

  5. linux7 epel源,为CentOS7添加EPEL源

    8种机械键盘轴体对比 本人程序员,要买一个写代码的键盘,请问红轴和茶轴怎么选? EPEL (Extra Packages for Enterprise Linux) 是Fedora小组维护的一个软件仓 ...

  6. 搭建yum源仓库和配置epel源

    制作本地yum源 本地yum源是利用光盘镜像作为本地yum源 挂载光盘到/mnt/cdrom目录 mount /dev/cdrom /mnt/cdrom 在/etc/yum.repos/目录下创建dv ...

  7. CentOS7安装EPEL源

    CentOS7安装EPEL [lijiayun@centos-*** ~]$ yum install epel-release 已加载插件:fastestmirror, langpacks 您需要 r ...

  8. linux7 epel源,CentOS7安装EPEL源

    CentOS7安装EPEL [lijiayun@centos-*** ~]$ yum install epel-release 已加载插件:fastestmirror, langpacks 您需要 r ...

  9. CentOS7配置EPEL存储库

    如果在CentOS 7上执行`sudo yum install tcpreplay`命令后提示"没有可用软件包 tcpreplay",可能是因为您的系统没有配置EPEL存储库. E ...

最新文章

  1. Kernel Video Converter中文版
  2. 案例开发分析 || ​​​​​​​Scheduler组件
  3. JavaScript高级day02-AM【函数的prototype、显式原型与隐式原型、原型链】
  4. Centos6.9以下查看端口占用情况和开启端口命令
  5. LeetCode:输出整体轮廓线和最长子数组长度
  6. Xamarin只言片语4——Xamarin.Android百度地图绑定
  7. C# 数据类型映射 (SQLite,MySQL,MSSQL,Oracle)
  8. DCASE三次挑战赛概览
  9. 微信小程序 WXBizDataCrypt 解密 报错
  10. VMware NSX系列教程-部署NSX Manager(转)
  11. jQuery Mobile中面板panel的data-*选项
  12. 关于svn汉化包安装无效的解决办法
  13. linux定时情况root mail,Linux_Linux系统下mail命令使用,我经常用root帐号登录RHEL5,在 - phpStudy...
  14. 购买服务器不显示d盘,购买云服务器后d盘
  15. 全自动采集小说模板源码+送7条可用7大采集规则
  16. android打开教程,Android 打开网络上pdf文件
  17. 外链应该这样发,网站排名速度提升十陪 1
  18. 超详细 PHP 开发环境配置:WampServer+ZendStudio+XDebug
  19. 健身场馆应用软件提供商
  20. j2ee上机任务汇总(上)

热门文章

  1. android preference控件,Android Preference 设置项简单使用详解
  2. 在项目中使用vue过滤器小结
  3. 基于Attention U-Net的宠物图像分割
  4. 2022-2027年中国东北大米行业发展前景及投资战略咨询报告
  5. 国企 外企 民企的区别
  6. 现况调查的方法及种类
  7. 华为“捅破天”,P60扛大旗
  8. 如何写出一篇优秀得csdn的文章?为什么要写作?有什么好处?(送给正在努力的你们)
  9. ubuntu server双网卡设置静态IP*(同网关)
  10. 数据库:Win11安装数据库