解决Centos7使用yum 下载速度慢的问题

1、首先备份系统自带yum源配置文件/etc/yum.repos.d/CentOS-Base.repo

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

2、下载ailiyun的yum源配置文件到/etc/yum.repos.d/

# 查看系统版本 
cat /etc/redhat-release  

#各系统版本repo文件对应的下载操作 
# CentOS 5 
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo 

# CentOS 6 
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo 

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

3、运行yum makecache生成缓存

yum clean all 
yum makecache
posted @ 2022-08-30 17:06  汉学  阅读(1296)  评论(0编辑  收藏  举报