centos7,yum源设置如下:

第一步:新建备份目录

mkdir /etc/yum.repo.d/repo-bak

第二步:备份现有的yum源配置文件

mv /etc/yum.repo.d/*.repo /etc/yum.repo.d/repo-bak

第三步:下载基本源

# Base源
curl -o /etc/yum.repo.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

第四步:下载epel源

# EPEL源 
curl -o /etc/yum.repo.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

第五步:更新缓存

yum clean all
yum makecache

centos8,yum源设置如下:

基本源

# Base源
mkdir /etc/yum.repo.d/repo-bak
mv /etc/yum.repo.d/*.repo /etc/yum.repo.d/repo-bak
wget -O /etc/yum.repo.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

EPEP源

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

更新缓存

yum clean all 
yum makecache

 

声明:欢迎大家光临本站,学习IT运维技术,转载本站内容,请注明内容出处”来源刘国华教育“。如若本站内容侵犯了原著者的合法权益,请联系我们进行处理。