1. 备份原镜像
mkdir -p /etc/yum.repos.d/backup
mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup
2. 配置国内镜像(二选一)
2.1 配置阿里云开源镜像
cd /etc/yum.repos.d
wget http://mirrors.aliyun.com/repo/Centos-7.repo
2.2 配置Nexus私服镜像
# nexus3代理的地址 在neuxs上直接copy
REPO_URL=https://registry.ochaly.com/repository/yum-public/
cat > /etc/yum.repos.d/nexus.repo << EOF
[base]
name=Nexus
baseurl=$REPO_URL\$releasever/os/\$basearch/
enabled=1
gpgcheck=0
[extras]
name=Nexus
baseurl=$REPO_URL\$releasever/extras/\$basearch/
enabled=1
gpgcheck=0
[centosplus]
name=Nexus
baseurl=$REPO_URL\$releasever/centosplus/\$basearch/
enabled=1
gpgcheck=0
EOF
3. 清除系统yum缓存并生成新的yum缓存
yum clean all
yum makecache
评论区