Centos如何更换yum源

1.切换到centos自带的yum源目录

cd /etc/yum.repos.d

2.将系统的自带的yum源文件进行备份

cp CentOS-Base.repo CentOS-Base.repo.bak

3.更换yum源

sudo curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

4.yum clean all   #清除旧的yum缓存
5.yum makecache   #生成新的yum缓存
6.yum update -y  #更新软件包

你可能感兴趣的:(centos,linux,运维)