【阿里云镜像】配置阿里巴巴开源镜像站镜像——Epel镜像

简介: 【阿里云镜像】配置阿里巴巴开源镜像站镜像——Epel镜像

一、📌 参考链接


阿里巴巴开源镜像站-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源🎃


[root@centos ~]# yum clean all
[root@centos ~]# yum repolist


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


mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
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系统为例)


[root@centos ~]# hostnamectl
   Static hostname: centos
         Icon name: computer-vm
           Chassis: vm
        Machine ID: f6fc8fb7991c4c518238af7c75f16046
           Boot ID: 543d1319d8164d8dac9e789e553f3ae5
    Virtualization: vmware
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-1160.el7.x86_64
      Architecture: x86-64
[root@centos ~]#
[root@centos ~]# yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm
Loaded plugins: fastestmirror
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
Marking /var/tmp/yum-root-_WgcRs/epel-release-latest-7.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-14 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================================================== Package                    Arch                 Version              Repository                                   Size
========================================================================================================================Installing:
 epel-release               noarch               7-14                 /epel-release-latest-7.noarch                25 k
Transaction Summary
========================================================================================================================Install  1 Package
Total size: 25 k
Installed size: 25 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : epel-release-7-14.noarch                                                                             1/1   Verifying  : epel-release-7-14.noarch                                                                             1/1 
Installed:
  epel-release.noarch 0:7-14                                                                                            
Complete!
[root@centos ~]#
[root@centos ~]# cd /etc/yum.repos.d/
[root@centos yum.repos.d]# ll
total 60
-rw-r--r--. 1 root root 2523 Nov 28 18:12 CentOS-Base.repo
-rw-r--r--. 1 root root 1664 Oct 23  2020 CentOS-Base.repo.backup
-rw-r--r--. 1 root root 1309 Oct 23  2020 CentOS-CR.repo
-rw-r--r--. 1 root root  649 Oct 23  2020 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root  314 Oct 23  2020 CentOS-fasttrack.repo
-rw-r--r--. 1 root root  630 Oct 23  2020 CentOS-Media.repo
-rw-r--r--. 1 root root 1331 Oct 23  2020 CentOS-Sources.repo
-rw-r--r--. 1 root root 8515 Oct 23  2020 CentOS-Vault.repo
-rw-r--r--. 1 root root  616 Oct 23  2020 CentOS-x86_64-kernel.repo
-rw-r--r--  1 root root 2081 Dec  3 09:23 docker-ce.repo
-rw-r--r--  1 root root 1358 Sep  5 01:37 epel.repo
-rw-r--r--  1 root root 1457 Sep  5 01:37 epel-testing.repo
-rw-r--r--  1 root root  276 Dec  8 13:15 kubernetes.repo


2)将 repo 配置中的地址替换为阿里云镜像站地址 👑


sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*
sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*


[root@centos yum.repos.d]# sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*
[root@centos yum.repos.d]# sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*


4、更新YUM源 🔒


[root@centos yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base epel extras updates
Cleaning up list of fastest mirrors
[root@centos yum.repos.d]# yum repolist
Loaded plugins: fastestmirror
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/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
base/7/x86_64  CentOS-7 - Base - mirrors.aliyun.com      10,072
epel/x86_64   Extra Packages for Enterprise Linux 7 - x86_64   13,691
extras/7/x86_64   CentOS-7 - Extras - mirrors.aliyun.com       500
updates/7/x86_64   CentOS-7 - Updates - mirrors.aliyun.com 3,190
repolist: 27,453
[root@centos yum.repos.d]#
相关文章
|
Linux 开发工具
Kali Linux配置阿里源
在配置Linux系统源前,建议先备份源列表。打开`/etc/apt/sources.list`,将原有官方源注释或删除,然后可以选择添加国内镜像源,如中科大、阿里云、清华大学、浙大或东软等源。确保每个源格式正确,以`deb`开头,`main non-free contrib`结尾。保存并退出(使用`:wq`或`:wq!`),之后运行`apt-get update`来下载新配置的源并验证是否成功。如果下载速度慢,可中断(`Ctrl+C`)后更换网络重试。
3640 0
Yum工具详解(二)-----Yum配置阿里源
Yum工具详解(二)-----Yum配置阿里源
5800 1
|
缓存 Linux 开发工具
CentOS 7- 配置阿里镜像源
阿里镜像官方地址http://mirrors.aliyun.com/ 1、点击官方提供的相应系统的帮助 :2、查看不同版本的系统操作: 下载源1、安装wget yum install -y wget2、下载CentOS 7的repo文件wget -O /etc/yum.
266803 0
|
12月前
|
Linux 数据安全/隐私保护 开发者
Red Hat下载ISO镜像的方法
简介:本文介绍如何注册或登录Red Hat账号,选择并下载Red Hat Enterprise Linux (RHEL)的免费版本,以及激活订阅的步骤。首先访问Red Hat官网注册或登录账号,然后在开发者页面选择免费下载RHEL,最后通过终端命令激活订阅,确保状态已订阅。订阅为期一年,到期后需重新注册以继续享受支持和权益。
4583 17
Red Hat下载ISO镜像的方法
|
安全 前端开发 Java
解决Spring Boot中的跨域请求问题
解决Spring Boot中的跨域请求问题
|
应用服务中间件 nginx Docker
配置Containerd运行时镜像加速器
containerd配置国内容器镜像加速器
4702 1
|
Linux 虚拟化 开发者
一键将CentOs的yum源更换为国内阿里yum源
一键将CentOs的yum源更换为国内阿里yum源
21338 31
|
缓存 Linux
epel源和yum源有什么不同
此处使用了虚构的URL作为示例,请根据实际情况替换为正确的仓库地址。
1108 0
|
监控 Ubuntu Docker
如何在Docker容器启动时自动运行脚本
【8月更文挑战第13天】在Docker容器启动时自动运行脚本可通过以下方式实现:1) 使用`ENTRYPOINT`或`CMD`指令在Dockerfile中直接指定启动脚本,如`ENTRYPOINT ["/startup.sh"]`;2) 启动容器时通过`--entrypoint`参数指定脚本路径;3) 利用supervisor等进程管理工具自动启动与监控脚本,确保其稳定运行。确保脚本具有执行权限并正确设置依赖资源路径。
3342 1