centos7更换yum源

傀儡师
2023-08-12 / 0 评论 / 28 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2024年02月15日,已超过92天没有更新,若内容或图片失效,请留言反馈。

准备工作

检查wget是否安装

wget -V

安装

yum install wget -y

1、备份原有yum源

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

2、选择可用的yum源

阿里云

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

163

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

3、生成缓存

yum clean all  # 清除yum缓存
yum makecache  # 重建缓存
yum -y update  # 升级所有包
0

评论 (0)

取消
歌曲封面
0:00