CentOS修改默认的yum源为国内源

文章目录

修改为阿里源

备份默认的yum源文件

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

下载阿里源文件

  • CentOS7版本
    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
    
  • CentOS6版本
    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
    

提示:如果CentOS系统没有wget命令,且因为yum默认源问题导致无法安装wget的话,也可以直接浏览器访问http网址,下载repo文件,然后上传到CentOS指定目录

刷新yum缓存

yum makecache

猜你喜欢

转载自blog.csdn.net/supermao1013/article/details/83054208