安装最小化的CentOS7后,执行yum命令报错Could not resolve host mirrorlis ...

打印 上一主题 下一主题

主题 1771|帖子 1771|积分 5313

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

x
安装最小化的CentOS7后,执行yum命令报错"Could not resolve host: mirrorlist.centos.org; 未知的错误"

错误

  1. [root@anonymous yum.repos.d]# yum list lrzsz
  2. 已加载插件:fastestmirror, langpacks
  3. Loading mirror speeds from cached hostfile
  4. Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
  5. 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误"
  6. One of the configured repositories failed (未知),
  7. and yum doesn't have enough cached data to continue. At this point the only
  8. safe thing yum can do is fail. There are a few ways to work "fix" this:
  9.      1. Contact the upstream for the repository and get them to fix the problem.
  10.      2. Reconfigure the baseurl/etc. for the repository, to point to a working
  11.         upstream. This is most often useful if you are using a newer
  12.         distribution release than is supported by the repository (and the
  13.         packages for the previous distribution release still work).
  14.      3. Run the command with the repository temporarily disabled
  15.             yum --disablerepo=<repoid> ...
  16.      4. Disable the repository permanently, so yum won't use it by default. Yum
  17.         will then just ignore the repository until you permanently enable it
  18.         again or use --enablerepo for temporary usage:
  19.             yum-config-manager --disable <repoid>
  20.         or
  21.             subscription-manager repos --disable=<repoid>
  22.      5. Configure the failing repository to be skipped, if it is unavailable.
  23.         Note that yum will try to contact the repo. when it runs most commands,
  24.         so will have to try and fail each time (and thus. yum will be be much
  25.         slower). If it is a very temporary problem though, this is often a nice
  26.         compromise:
  27.             yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
  28. Cannot find a valid baseurl for repo: base/7/x86_64
复制代码
办理方案:

(确保可以或许ping通114.114.114.114)
1.更新base.repo源
1.11备份文件
  1. mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
复制代码
1.12下载新的CentOS-Base.repo 到/etc/yum.repos.d/
  1. wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
复制代码
1.13运行yum makecache生成缓存

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
回复

举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

温锦文欧普厨电及净水器总代理

论坛元老
这个人很懒什么都没写!
快速回复 返回顶部 返回列表