解决CentOS7用yum安装软件显示错误:cannot find a valid baseurl for repo: base/7/x86_64
使用yun安装软件时有时会报repo文件的错误,, 主要问题出自于CentOS-Base.repo文件

解决方案:将这个文件后缀名修改使这个文件无效
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.bak
[root@localhost yum.repos.d]# ls
CentOS-Base.repo.bak CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo
接下来可以继续进行yum的安装
===================================================================================
Centos7系统安装yum遇到的问题failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try. http:
原创果冻先生的专栏 最后发布于2018-06-10 17:50:03 阅读数 45807 收藏
展开
当遇到这个问题的时候,发现网上也有很多人也在问同样的问题。但是发现大家问的问题,很少有人能解释得很清楚,而且很多人的解决方法复杂且不能解决问题。我查了近二十篇博客和文章,对照做了,但是基本解决不了问题。
http://mirrors.ustc.edu.cn/help/centos.html
http://mirrors.163.com/.help/centos.html
https://blog.csdn.net/dreamchasering/article/details/77160477
https://blog.csdn.net/shaoqiufeng/article/details/78785806
https://blog.csdn.net/orangleliu/article/details/40588799
https://www.cnblogs.com/yizhichun/p/6339742.html
https://blog.csdn.net/james_jr10/article/details/78357600(这个好像很厉害,但是写得不清晰,误我前程啊)
https://segmentfault.com/q/1010000000716991/a-1020000000717340
你来看看,这些问题有多少人问?但是能解决实际问题的却很少!!!
下面由我给出一种最简单最有效的方法。耐心看下去哦!
问题所在:
[root@cit-server6-s1-372 yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
base | 5.6 kB 00:00:00
http://mirrors.163.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
Trying other mirror.
One of the configured repositories failed (CentOS-7 - Base - 163.com),
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. Disable the repository, 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
4. 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.163.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for base: Damaged repomd.xml file
[root@cit-server6-s1-372 yum.repos.d]#
错误所在的问题:
主要问题在于yum源问题。
下面开始解决问题:
4.下载yum依赖包
[root@localhost ~]# wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm
--2020-02-09 16:01:35-- http://vault.centos.org/7.2.1511/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm
正在解析主机 vault.centos.org (vault.centos.org)... 208.100.23.71
正在连接 vault.centos.org (vault.centos.org)|208.100.23.71|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:30600 (30K) [application/x-rpm]
正在保存至: “yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm”
100%[==================================================================================================================>] 30,600 6.47KB/s 用时 4.6s
2020-02-09 16:01:40 (6.47 KB/s) - 已保存 “yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm” [30600/30600])
[root@localhost ~]# wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
--2020-02-09 16:01:43-- http://vault.centos.org/7.2.1511/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
正在解析主机 vault.centos.org (vault.centos.org)... 208.100.23.71
正在连接 vault.centos.org (vault.centos.org)|208.100.23.71|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:28348 (28K) [application/x-rpm]
正在保存至: “yum-metadata-parser-1.1.4-10.el7.x86_64.rpm”
100%[==================================================================================================================>] 28,348 2.16KB/s 用时 6.4s
2020-02-09 16:01:50 (4.34 KB/s) - 已保存 “yum-metadata-parser-1.1.4-10.el7.x86_64.rpm” [28348/28348])
[root@localhost ~]# ls
anaconda-ks.cfg initial-setup-ks.cfg yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm 模板 图片 下载 桌面
core.8499 yum-metadata-parser-1.1.4-10.el7.x86_64.rpm 公共 视频 文档 音乐
[root@localhost ~]# mv yum-* /etc/yum.
yum.conf yum.repos.d/
[root@localhost ~]# mv yum-* /etc/yum.repos.d/
[root@localhost ~]# ls
anaconda-ks.cfg core.8499 initial-setup-ks.cfg 公共 模板 视频 图片 文档 下载 音乐 桌面
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
a Centos-7.repo docker-ce.repo local.repo yum-metadata-parser-1.1.4-10.el7.x86_64.rpm yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm
[root@localhost yum.repos.d]# rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
准备中... ################################# [100%]
软件包 yum-metadata-parser-1.1.4-10.el7.x86_64 已经安装
[root@localhost yum.repos.d]# rpm -ivh yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm
准备中... ################################# [100%]
软件包 yum-plugin-fastestmirror-1.1.31-50.el7.noarch (比 yum-plugin-fastestmirror-1.1.31-34.el7.noarch 还要新) 已经安装
file /usr/lib/yum-plugins/fastestmirror.py from install of yum-plugin-fastestmirror-1.1.31-34.el7.noarch conflicts with file from package yum-plugin-fastestmirror-1.1.31-50.el7.noarch
file /usr/lib/yum-plugins/fastestmirror.pyc from install of yum-plugin-fastestmirror-1.1.31-34.el7.noarch conflicts with file from package yum-plugin-fastestmirror-1.1.31-50.el7.noarch
file /usr/lib/yum-plugins/fastestmirror.pyo from install of yum-plugin-fastestmirror-1.1.31-34.el7.noarch conflicts with file from package yum-plugin-fastestmirror-1.1.31-50.el7.noarch
[root@localhost yum.repos.d]# ls
a Centos-7.repo docker-ce.repo local.repo yum-metadata-parser-1.1.4-10.el7.x86_64.rpm yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm
[root@localhost yum.repos.d]# cd a/
[root@localhost a]# ls
CentOS-Base.repo CentOS-CR.repo CentOS-Debuginfo.repo CentOS-fasttrack.repo CentOS-Media.repo CentOS-Sources.repo CentOS-Vault.repo
[root@localhost a]# cp CentOS-Base.repo CentOS-Base.repo.bak
[root@localhost a]# mv CentOS-Base.repo ../
[root@localhost a]# cd ../
[root@localhost yum.repos.d]# ls
a CentOS-Base.repo local.repo yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm
Centos-7.repo docker-ce.repo yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
[root@localhost yum.repos.d]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
[root@localhost yum.repos.d]# yum clean all
[root@localhost yum.repos.d]# yum makecache
解决CentOS7用yum安装软件显示错误:cannot find a valid baseurl for repo: base/7/x86_64的更多相关文章
- 解决方法:CentOS7用yum安装软件显示错误:cannot find a valid baseurl for repo: base/7/x86_64
在Linux学习中,发现使用yum安装软件出现以下的错误: 百度了各种方法,很多人也发现光是修改REBOOT=yes也没用,多次进行挂载.修改网卡配置文件.重置IP地址.重启网络.创建又删除配置文件的 ...
- 【已解决】CentOS7使用yum安装Docker显示错误:cannot find a valid baseurl for repo: base/7/x86_64
不得不说,Docker 要求 CentOS 系统的内核版本高于 3.10,这就让有些人开始头疼了,而要查看具体的版本可以用以下命令 uname -r 当然,CentOS 6.8版本也能安装Docker ...
- Cent OS 6/7 中通过yum安装软件时提示cannot find a valid baseurl...的解决方法
目录 1 问题描述 2 解决方法一 (Cent OS 7中有效) 3 解决方法二 (Cent OS 7中无效) 1 问题描述 新申请了虚拟机, 系统版本是Cent OS 7.2. 在安装软件的过程中, ...
- 安装centos mini版,无法联网,用yum安装软件提示 cannot find a valid baseurl for repo:base/7/x86_64 的解决方法
*无法联网的明显表现会有: cannot find a valid baseurl for repo:base/7/x86_64 1.yum install出现 Error: cannot find ...
- CENTOS7错误:Cannot find a valid baseurl for repo: base/7/x86_6
CENTOS7错误:Cannot find a valid baseurl for repo: base/7/x86_6 解决办法: 1.进入/etc/sysconfig/network-script ...
- Linux安装Apache报错:Cannot find a valid baseurl for repo: base/7/x86_64解决方案
最近使用CentOS7学习,安装安装Apache时候,使用yum安装Apache报错:本文适合CentOS7和RHEL7 # yum install httpd 出现:cannot find a va ...
- 安装CentOS7文字界面版后,无法联网,用yum安装软件提示 cannot find a valid baseurl for repo:base/7/x86_64 的解决方法
*无法联网的明显表现会有: 1.yum install出现 Error: cannot find a valid baseurl or repo:base 2.ping host会提示unknown ...
- 安装CentOS7后,无法联网,用yum安装软件提示 cannot find a valid baseurl for repo:base/7/x86_64 的解决方法
无法联网的明显表现会有: 1.yum install出现 Error: cannot find a valid baseurl or repo:base 2.ping host会提示unknown h ...
- 用yum安装软件提示 cannot find a valid baseurl for repo:base/7/x86_64 的解决方法
*无法联网的明显表现会有: 1.yum install出现 Error: cannot find a valid baseurl or repo:base 2.ping host会提示unknown ...
随机推荐
- js面向过程 分页功能
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- fileupload插件调用upload.parseRequest(request)解析得到空值问题
得到的list长度是0,项目配置不能改变,没办法了,只能将HttpServletRequest强换成DefaultMultipartHttpServletRequest ,直接获取表单中的字段了.方法 ...
- css之变形(transform)
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- Qt5 error LNK2019 无法解析的外部符号的解决办法
今天在使用Qt Create 4.5.2时遇到一个莫名其妙的问题: 在原有工程里添加一个新类(有界面的),在调用的mainwindow.cpp中添加#include "a.h",然 ...
- idea中的springboot+gradle项目报错springboot configuration annotation processor not found in classpath
idea中的springboot项目,打开某个类run.halo.app.config.properties.HaloProperties.java,报错(使用gradle编译): springboo ...
- 【Vue常用指令】
目录 v-html v-text v-for v-if v-show v-bind v-on v-model 指令修饰符 计算与侦听属性 自定义属性 获取DOM元素 "@ *** Vue.j ...
- 阻塞式I/0 和 非阻塞式I/O 同步异步详细介绍
请求描述: `阻塞/非阻塞` 和 `同步/异步` 不是一个概念.举几个简单的例子. 当进程调用一个进行IO操作的API时(比如read函数),在数据没有到达前,read 会挂起,进程会卡住.在数据读取 ...
- mysql 慢查询日志 (mysqldumpslow坑还没填)
MySQL的慢查询日志是MySQL提供的一种日志记录,用来记录在MySQL中响应时间超过long_query_time值的SQL语句(秒为单位). 默认情况下MySql数据库没有开启慢查询日志, my ...
- 如何用纯代码实现图片CSS3
在刷面试题的时候刷到2015阿里巴巴的,如何用代码实现下面的图形. <div class="main"> <h1>图片图标-一个标签实现</h1> ...
- 【原】移动端vue页面点透事件 - 分析与解决
近期项目遇到了vue页面事件被带到下一个页面的问题,也就是我们常说的点透事件,主要表现在android机器上,花了不少时间折腾,简单做下总结~ vue页面之间的切换通过Vue Router的route ...