centos系統配置yum的國內映象源

蓝色星辰1993發表於2024-09-14

1、編輯 /etc/yum.repos.d/CentOS-Base.repo 檔案:

$ cd /etc/yum.repos.d #進入
$ mv CentOS-Base.repo CentOS-Base.repo.back #備份
$ vi CentOS-Base.repo 
[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.aliyun.com/centos/7/os/x86_64/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

2、清除YUM快取

$ sudo yum clean all
$ sudo yum makecache

參考文件:https://blog.csdn.net/qq_36973540/article/details/140261982

相關文章