CentOS7安装docker时,yum命令报错。Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=

问题描述

当我需要在centOS7中安装docker时,会使用到yum命令,例如sudo yum install -y yum-utils。只要使用到yum命令时,就会报出如下错误:

[root@localhost ~]# yum install wget
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - “Could not resolve host: mirrorlist.centos.org; 未知的错误”

yum命令报错Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock。从这命令可以看出来,http://mirrorlist.centos.org/挂掉了,使用魔法去访问一下,发现服务一直报403错误,这是服务器的问题,可以理解为挂了。因为centOS在今年6.30后就不再维护了。

解决方案

	既然国外的yum源不好用了,那就替换为国内的,我使用的是阿里的。

目标

	更改 CentOS 7 系统的软件仓库源,从官方的 CentOS 镜像源切换到阿里云的 CentOS 7 镜像源,以获得更快的下载速度和更好的稳定性。

解决步骤

步骤一:前置准备

网络通畅

	由于我使用的是vmware虚拟机,所以以此为基础进行展示。

要求:要能ping通百度。
[root@localhost ~]# ping baid

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值