一、配置CentOS镜像仓库

1.备份

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2.安装 wget自动下载工具

yum -y install wget

3.下载新的CentOS-Base.repo到 /etc/yum.repos.d/

CentOS 7

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

4.深入了解

深入了解

https://developer.aliyun.com/mirror/	#阿里巴巴开源镜像站中的centos

二、配置Epel镜像仓库

1.备份(如有配置其他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

2.下载新repo 到/etc/yum.repos.d/

[epel(RHEL 8)]
(1)安装 epel 配置包

yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm

(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*

epel(RHEL 7)
(1)安装 wget自动下载工具

yum -y install wget

(1)下载epel.repo到/etc/yum.repos.d目录下

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

3.深入了解

深入了解

https://developer.aliyun.com/mirror/	#阿里巴巴开源镜像站中的epel

三、了解wget自动下载工具(扩展)

网址:https://baike.baidu.com/item/wget/9925250?fr=aladdin
Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐