1.首先确保自己虚拟能够连网测试一下:
ping ·
2.备份原始镜像:mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
3.安装wget:yum -y install wget
4.下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/:wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
如出现报错信息用使用curl命令,取代wget命令进行镜像的下载:
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
5.更新镜像yum clean all #清理源缓存
yum makecache #创建新缓存
6.进入yum源的配置路径,打开CentOS-Base.repo文件并改写配置文件,将 所有的http改为httpsvi /etc/yum.repos.d/`CentOS-Base.repo`
?7.更新yumyum update
1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,会注明原创字样,如未注明都非原创,如有侵权请联系删除!;3.作者投稿可能会经我们编辑修改或补充;4.本站不提供任何储存功能只提供收集或者投稿人的网盘链接。 |
标签: #centos阿里云镜像 #y #install #wget4下载新的