| Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile http://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.cloud.aliyuncs.com; Unknown error" Trying other mirror. One of the configured repositories failed (CentOS-7), and yum doesn't have enough cached data to continue. At this point the only safe thing yum can do is fail. There are a few ways to work "fix" this: 1. Contact the upstream for the repository and get them to fix the problem. 2. Reconfigure the baseurl/etc. for the repository, to point to a working upstream. This is most often useful if you are using a newer distribution release than is supported by the repository (and the packages for the previous distribution release still work). 3. Run the command with the repository temporarily disabled yum --disablerepo=base ... 4. Disable the repository permanently, so yum won't use it by default. Yum will then just ignore the repository until you permanently enable it again or use --enablerepo for temporary usage: yum-config-manager --disable base or subscription-manager repos --disable=base 5. Configure the failing repository to be skipped, if it is unavailable. Note that yum will try to contact the repo. when it runs most commands, so will have to try and fail each time (and thus. yum will be be much slower). If it is a very temporary problem though, this is often a nice compromise: yum-config-manager --save --setopt=base.skip_if_unavailable=true failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try. http://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.cloud.aliyuncs.com; Unknown error" |
我通过修改源地址可以解决
解决方案
1.首先进入 /etc/yum.repos.d 目录:
cd /etc/yum.repos.d
2.备份文件 CentOS-Base.repo,执行:
cp CentOS-Base.repo CentOS-Base.repo.bak
3.修改CentOS-Base.repo文件:
vi CentOS-Base.repo
:
%s#http://mirrors.cloud.aliyuncs.com/centos#http://mirrors.aliyun.com/centos#g
//说明:将文本中的htpp://mirrors.cloud.aliyuncs.com/centos批量替换为http://mirrors.aliyun.com/centos
4.备份epel.repo文件:
cp epel.repo epel.repo.bak
5.修改epel.repo文件
vi epel.repo
:
%s#http://mirrors.cloud.aliyuncs.com#http://mirrors.aliyun.com#g
//说明:上面的目录是批量替换字符
6.批量替换后就可以执行yum命令了,比如安装宝塔或对系统升级等
yum -y update
下面的所有服务器为独立物理服务器,不是虚拟的云主机(云服务器、VPS)
租用服务器请自觉遵守服务器所在地的法律法规,国内服务器禁止任何违法违规用途!!!
香港、韩国、日本、美国、台湾、新加坡、菲律宾等境外服务器由机房直供(一手资源,价格最低),我公司只是代购,请自行遵守中国法律和服务器所在地的法规,勿用于违法犯罪用途,做什么用途虽然机房不过问,但是如果您私自做违法用途请自担责任!需要租用服务器请联系QQ16764407或微信18988993510
境外服务器由机房直供(一手资源,价格最低),我公司只是代购,请自行遵守中国法律和服务器所在地的法规,勿用于违法犯罪用途,做什么用途虽然机房不过问,但是如果您做违法用途请自担责任!

以下国内独立物理服务器禁止任何违法违规用途:
国内高防服务器(推荐西安高防,单机防御高,线路好,互通互联,真实物理机,真实防御绝不虚夸):

香港高防服务器租用电话020-82315523 、QQ16764407
韩国普通线路服务器(建议用前面双线CN2线路韩国服务器,而且还可以+300元加100G防御):
韩国SK和LG的CN2线路服务器:
美国服务器租用:
