一、鏡像源修改
1. 備份原有的鏡像源配置文件
在修改之前,先備份現有的 CentOS-Base.repo
文件:
sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2. 編輯鏡像源配置文件
使用文本編輯器(如 nano
或 vi
)打開 /etc/yum.repos.d/CentOS-Base.repo
文件:
sudo vim /etc/yum.repos.d/CentOS-Base.repo
將文件內容替換為以下阿里云鏡像源的配置:
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually pi