Centos修改镜像为国内的阿里云源

众所周知的原因,原版的镜像下载会比较慢,建议改成阿里的会比较快。

1 备份你的原镜像文件,以免出错后可以恢复。
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2下载新的CentOS-Base.repo 到/etc/yum.repos.d/
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
如果没有安装wget,可以运行下面命令,安装wget

yum -y install wget
如果你的系统是其他版本可以查看http://mirrors.aliyun.com/repo/
对应命令

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
3运行yum makecache生成缓存
yum makecache
其他不错的源

网易开源镜像站:http://mirrors.163.com/
中科大的Linux安装镜像源:http://centos.ustc.edu.cn/
搜狐的Linux安装镜像源:http://mirrors.sohu.com/

posted @ 2022-02-11 20:23  公子初心  阅读(173)  评论(0编辑  收藏  举报