yum 安装失败解决思路$releasever(curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error")
问题
公司使用刀片机的系统版本是CentOS 7.9.2009(Core),本人在重新安装虚拟机时,也使用对应的系统版本,在安装软件时,yum无法正常使用,一开始觉得,centos的release版本默认配置和默认镜像不可能有问题,所有怀疑是网络问题,然后就试着折腾,各种配置,各种ping,折腾了好长时间,最后发现是yum的问题,然后就卸载重装默认的yum,结果还是不行,最终通过学习yum的相关配置才解决问题。
通过设置远程镜像url的参数值$releasever为7就可以了。
排查分析
- ping命名,看是否是网络配置问题;
- 查看/etc/resolv.conf,看配置是否正确,可以增加一行配置nameserver 114.114.114.114,执行命令chattr +i /etc/resolv.conf,然后重启systemctl restart network试下;
- 根据提示不能解析主机:mirrorlist.centos.org,开始以为是因为该yum所配置的镜像无法使用,在尝试更换为http://mirrors.ustc.edu.cn/之后还是不能使用;
- 跟着错误提示信息往下找,Cannot find a valid baseurl for repo: base/$releasever/x86_64,表示无效的url,然后就发现了$releasever参数,经过百度,发现该参数是指CentOS对应的版本号,(配置文件yum.conf中的distroverpkg=centos-release参数,通过这个配置可以获取到版本号),网上说是,centos-release没有安装,导致获取不到, 我通过命令rpm -qa centos-release查看该rpm包已经安装,但执行命令echo $releasever未输出任何内容,所有具体原因也不清楚,在网上也没有找到解决的方案,最后只能通过笨方法,直接修改repo仓库中的镜像url的参数值$releasever为7才解决问题。
如果增加远程仓库,需要确定是否包含参数$releasever,比如安装docker,也需要将/etc/yum.repos.d/docker-ce.repo中的$releasever替换掉
[root@localhost yum.repos.d]# yum install docker-ce docker-ce-cli containerd.io --installroot /usr/local/db-soft/docker
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=$releasever&arch=x86_64&repo=os&infra=$infra error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
One of the configured repositories failed (Unknown),
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=<repoid> ...
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 <repoid>
or
subscription-manager repos --disable=<repoid>
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=<repoid>.skip_if_unavailable=true
Cannot find a valid baseurl for repo: base/$releasever/x86_64
yum相关知识
/etc/yum.repos.d/ # yum的默认仓库地址
/etc/yum.conf # yum的默认配置文件
yum -y install # 安装,--installroot=[file]指定安装位置,--downloadonly只下载,不按照,--downloaddir指定下载目录
yum list # 查询安装列表,可以配合grep使用
yum update # 更新系统的包
yum-config-manager --add-repo [url] # 添加远程镜像url
但有个疑问:明明安装了centos-release,为啥在解析url时,无法将$releasever替换成对于的版本号(7)?如果有哪位大佬知道,可以分享下
yum 安装失败解决思路$releasever(curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error")的更多相关文章
- yum 安装报错: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; Unknown error"
[root@venn09 ~]# yum install -y vim Loaded plugins: fastestmirror Could not retrieve mirrorlist http ...
- CentOS报错:Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock32 error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
今天安装完带图形界面的CentOS 7后,在Terminal中运行yum安装命令时报了以下错误: Could not retrieve mirrorlist http://mirrorlist.cen ...
- Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock32 error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
今天安装完带图形界面的CentOS 7后,在Terminal中运行yum安装命令时报了以下错误: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...
- yum安装软件报错:curl#6 - "Could not resolve host: mirrorlist.centos.org; Temporary failure in name resolut
# yum install -y epel-release Loaded plugins: fastestmirror Repository base is listed more than once ...
- "Could not resolve host: mirrorlist.centos.org; Unknown error"解决方法
这两天学习历程可谓历尽坎坷,昨天在vSphere Client中安装完CentOS系统后,今天尝试在系统中安装mysql数据库. 由于刚接触Linux,所以对于一些常用指令和操作并不熟悉,也是一边百度 ...
- 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误"
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误" One of the configured ...
- Linux安装yum install gcc-c++出错: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...
错误如图: 解决办法: 1.修改配置文件 /etc/resolv.conf,该配置文件如下: 2.输入:gedit resolv.conf,修改配置文件内容如下: 3.然后重启: 4.重新进行安装: ...
- YUM安装软件提示[Errno 14] curl#6 - "Could not resolve host: mirrors.cloud.aliyuncs.com; 未知的错误"
报错如下: 翻译过来就是 所以问题很简单: 第一种情况:本地DNS服务错误 第二种情况:远程主机挂了 第三种情况:远程主机地址配置错误 第一种解决方法:换DNS 首先验证一下是不是本地DNS错误 从上 ...
- curl: (6) Could not resolve host: mirrors.163.com; Unknown error 服务器上解析不了域名,换成ip可以
原因是DNS域名解析问题: 添加nameserver即可解决 echo nameserver 8.8.8.8 > /etc/resolv.conf 解释一下DNS服务 DNS(Domain Na ...
- 20200311_解决Could not resolve host: mirrorlist.centos.org
[root@localhost ~]# yum -y install wget 已加载插件:fastestmirror Determining fastest mirrors Could not re ...
随机推荐
- 【eBPF-04】进阶:BCC 框架中 BPF 映射的应用 v2.0——尾调用
这两天有空,继续更新一篇有关 eBPF BCC 框架尾调用的内容. eBPF 技术很新,能够参考的中文资料很少,而对于 BCC 框架而言,优秀的中文介绍和教程更是凤毛麟角.我尝试去网上检索有关尾调用的 ...
- let、var、const区别
1.var:传统的变量声明方式 在ES5及之前的JavaScript版本中,我们通常使用var关键字声明变量.var具有以下特点: 函数作用域:变量的作用域限制在声明的函数内部,如果在函数外部访问,将 ...
- GitLab--安装部署
配置信息 系统:centos7.8 gitlab版本:12.8.8 1 下载gitlab wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum ...
- 从阿里云全球实时传输网络GRTN出发,浅谈QOE优化实践
直播已深入每家每户,以淘宝的直播为例,在粉丝与主播的连麦互动中如何实现无感合屏或切屏?阿里云GRTN核心网技术负责人肖凯,在LVS2022上海站为我们分享了GRTN核心网的运作机制.运用方面以及QOE ...
- Google C++编程规范(Google C++ Style Guide)
参考链接: Google 代码规范 C++总结 Google 开源项目风格指南--中文版 Google C++ Style Guide是一份不错的C++编码指南,我制作了一张比较全面的说明图,可以在短 ...
- SAE 最佳实践范本:助力视野数科进入云原生“快车道”
阿里云生态金融科技行业标杆 -- 2021 年,云原生的商业价值正在被加速释放. 一个公认的事实是,Serverless 是当下云原生方向内绝对的亮点.可以看作,它的出现,让企业用户真正地免除 ...
- vue 调试工具vue-devtools 安装
一.下载 工具vue-devtools 注:必须是5.1.1版本 比这个版本高的试过,没法正确使用. https://github.com/vuejs/vue-devtools/tree/v5.1.1 ...
- 存储密码-ssh添加秘钥
- vue+elementUI+WebSocket接收后台实时消息推送
vue+elementUI+WebSocket接收后台实时消息推送 https://blog.csdn.net/weixin_40888956/article/details/105971432?ut ...
- JS单线程的理解
一.首先需要区分几个概念: 1. 进程和线程的概念: 进程:指在系统中运行的一个应用程序,目的就是担当分配系统资源(CPU时间.内存等)的基本单位 线程:系统分配处理器时间资源的基本单元,建立在进程的 ...