一、?参考链接

阿里巴巴开源镜像站-OPSX镜像站-阿里云开发者社区 (aliyun.com)

epel镜像-epel下载地址-epel安装教程-阿里巴巴开源镜像站 (aliyun.com)

阿里云开源镜像站资源目录 (aliyun.com)

二、?Epel 镜像简介

EPEL (Extra Packages for Enterprise Linux), 是由 Fedora Special Interest Group 维护的 Enterprise Linux(RHEL、CentOS)中经常用到的包。

下载地址:https://mirrors.aliyun.com/epel/

三、? 配置方法

1、更新YUM源?

  1. [root@centos ~]# yum clean all
  2. [root@centos ~]# yum repolist

2、 备份(如有配置原来的epel源)?

  1. mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
  2. mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup

3、下载新repo 到/etc/yum.repos.d/?

1)安装 epel 配置包?

安装对应的安装包(本实验以CentOS 7系统为例)

  1. [root@centos ~]# hostnamectl
  2. Static hostname: centos
  3. Icon name: computer-vm
  4. Chassis: vm
  5. Machine ID: f6fc8fb7991c4c518238af7c75f16046
  6. Boot ID: 543d1319d8164d8dac9e789e553f3ae5
  7. Virtualization: vmware
  8. Operating System: CentOS Linux 7 (Core)
  9. CPE OS Name: cpe:/o:centos:centos:7
  10. Kernel: Linux 3.10.0-1160.el7.x86_64
  11. Architecture: x86-64
  12. [root@centos ~]#
  13. [root@centos ~]# yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm
  14. Loaded plugins: fastestmirror
  15. epel-release-latest-7.noarch.rpm | 15 kB 00:00:00 Examining /var/tmp/yum-root-_WgcRs/epel-release-latest-7.noarch.rpm: epel-release-7-14.noarch
  16. Marking /var/tmp/yum-root-_WgcRs/epel-release-latest-7.noarch.rpm to be installed
  17. Resolving Dependencies
  18. --> Running transaction check
  19. ---> Package epel-release.noarch 0:7-14 will be installed
  20. --> Finished Dependency Resolution
  21. Dependencies Resolved
  22. ======================================================================================================================== Package Arch Version Repository Size
  23. ========================================================================================================================Installing:
  24. epel-release noarch 7-14 /epel-release-latest-7.noarch 25 k
  25. Transaction Summary
  26. ========================================================================================================================Install 1 Package
  27. Total size: 25 k
  28. Installed size: 25 k
  29. Downloading packages:
  30. Running transaction check
  31. Running transaction test
  32. Transaction test succeeded
  33. Running transaction
  34. Installing : epel-release-7-14.noarch 1/1 Verifying : epel-release-7-14.noarch 1/1
  35. Installed:
  36. epel-release.noarch 0:7-14
  37. Complete!
  38. [root@centos ~]#
  39. [root@centos ~]# cd /etc/yum.repos.d/
  40. [root@centos yum.repos.d]# ll
  41. total 60
  42. -rw-r--r--. 1 root root 2523 Nov 28 18:12 CentOS-Base.repo
  43. -rw-r--r--. 1 root root 1664 Oct 23 2020 CentOS-Base.repo.backup
  44. -rw-r--r--. 1 root root 1309 Oct 23 2020 CentOS-CR.repo
  45. -rw-r--r--. 1 root root 649 Oct 23 2020 CentOS-Debuginfo.repo
  46. -rw-r--r--. 1 root root 314 Oct 23 2020 CentOS-fasttrack.repo
  47. -rw-r--r--. 1 root root 630 Oct 23 2020 CentOS-Media.repo
  48. -rw-r--r--. 1 root root 1331 Oct 23 2020 CentOS-Sources.repo
  49. -rw-r--r--. 1 root root 8515 Oct 23 2020 CentOS-Vault.repo
  50. -rw-r--r--. 1 root root 616 Oct 23 2020 CentOS-x86_64-kernel.repo
  51. -rw-r--r-- 1 root root 2081 Dec 3 09:23 docker-ce.repo
  52. -rw-r--r-- 1 root root 1358 Sep 5 01:37 epel.repo
  53. -rw-r--r-- 1 root root 1457 Sep 5 01:37 epel-testing.repo
  54. -rw-r--r-- 1 root root 276 Dec 8 13:15 kubernetes.repo
2)将 repo 配置中的地址替换为阿里云镜像站地址?
  1. sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*
  2. sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*
  1. [root@centos yum.repos.d]# sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*
  2. [root@centos yum.repos.d]# sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*

4、更新YUM源?

  1. [root@centos yum.repos.d]# yum clean all
  2. Loaded plugins: fastestmirror
  3. Cleaning repos: base epel extras updates
  4. Cleaning up list of fastest mirrors
  5. [root@centos yum.repos.d]# yum repolist
  6. Loaded plugins: fastestmirror
  7. Determining fastest mirrors
  8. * base: mirrors.aliyun.com
  9. * extras: mirrors.aliyun.com
  10. * updates: mirrors.aliyun.com
  11. 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/7): base/7/x86_64/group_gz | 153 kB 00:00:00 (2/7): epel/x86_64/group_gz | 96 kB 00:00:00 (3/7): extras/7/x86_64/primary_db | 243 kB 00:00:02 (4/7): epel/x86_64/updateinfo | 1.0 MB 00:00:03 (5/7): base/7/x86_64/primary_db | 6.1 MB 00:00:06 (6/7): epel/x86_64/primary_db | 7.0 MB 00:00:06 (7/7): updates/7/x86_64/primary_db | 13 MB 00:00:07 repo id repo name status
  12. base/7/x86_64 CentOS-7 - Base - mirrors.aliyun.com 10,072
  13. epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 13,691
  14. extras/7/x86_64 CentOS-7 - Extras - mirrors.aliyun.com 500
  15. updates/7/x86_64 CentOS-7 - Updates - mirrors.aliyun.com 3,190
  16. repolist: 27,453
  17. [root@centos yum.repos.d]#

更多相关文章

  1. androidRadioGroup和RadioB…
  2. Android水波纹效果顺手拈来!
  3. Workbench连接不上阿里云服务器Ubuntu的Mysql解决方法(已测)
  4. android googlemap的location报空指针解决案例
  5. ndk 历史版本下载
  6. android滑动删除的一个开源项目SwipeDelMenuLayout的简单使用
  7. Android配置gradle 阿里云镜像
  8. Java基础查漏补缺:(开篇)为什么要在即将找工作的时候还在看Java基础
  9. 10个经典的Android开源应用项目

随机推荐

  1. golang最适合做什么项目
  2. golang如何编译
  3. golang导出csv乱码解决方法
  4. golang 乱码怎么解决
  5. golang判断字符串是否为空的方法
  6. golang怎么生成随机数
  7. golang 开源吗
  8. golang判断字符串是否数字的方法
  9. golang数组和切片的区别是什么
  10. golang用什么ide