RedHat7.9 如何配置yum源?

1.查看yum源信息:
yum repolist all
2.备份旧的配置文件
sudo mv /etc/yum.repos.d/xxxx.repo /etc/yum.repos.d/xxxx.repo.bak
3.下载阿里源的文件
sudo wget -O /etc/yum.repos.d/Centos-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
4.修改下载来的配置文件 $ releasever 替换为 7
sed s/$releasever/7/g /etc/yum.repos.d/Centos-Base.repo
5.清理缓存
yum clean all
6.重新生成缓存
yum makecache
7.再次查看yum源信息
yum repolist all

posted on 2025-03-07 15:43  sddhome  阅读(570)  评论(0)    收藏  举报

导航