本文共 689 字,大约阅读时间需要 2 分钟。
默认YUM源文件位于:/etc/yum.repos.d/CentOS-Base.repo
备份文件命令:
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
下载配置文件并保存到正确位置:
wget -O /etc/yum.repos.d/CentOS-Base.repo
注意:根据CentOS版本选择合适的仓库文件:
【CentOS 7】http://mirrors.aliyun.com/repo/Centos-7.repo
【CentOS 6】http://mirrors.aliyun.com/repo/Centos-6.repo
【CentOS 5】http://mirrors.aliyun.com/repo/Centos-5.repo
运行以下命令创建缓存:
yum makecache
执行更新命令以查看阿里云镜像信息:
yum -y update
推荐镜像站地址:
网易开源镜像站:http://mirrors.163.com/
清华大学镜像站:https://mirrors.tuna.tsinghua.edu.cn/
腾讯云软件镜像站:https://mirrors.cloud.tencent.com/centos/
南京大学镜像站:http://mirrors.nju.edu.cn/
转载地址:http://twufk.baihongyu.com/