CentOS7 更换为阿里镜像源
- 备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
- 下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
如果提示-bash: wget: command not found,则需要将步骤1中的备份文件还原,然后安装wget
yum install wget -y
- 添加EPEL
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
- 更新
# 清除缓存目录下的软件包及旧的 headers
yum clean all
# 生成缓存
yum makecache -y
# 升级所有包同时也升级软件和系统内核(看个人需要)
# yum update -y

浙公网安备 33010602011771号