使用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的更多相关文章

  1. 解决方法:CentOS7用yum安装软件显示错误:cannot find a valid baseurl for repo: base/7/x86_64

    在Linux学习中,发现使用yum安装软件出现以下的错误: 百度了各种方法,很多人也发现光是修改REBOOT=yes也没用,多次进行挂载.修改网卡配置文件.重置IP地址.重启网络.创建又删除配置文件的 ...

  2. 【已解决】CentOS7使用yum安装Docker显示错误:cannot find a valid baseurl for repo: base/7/x86_64

    不得不说,Docker 要求 CentOS 系统的内核版本高于 3.10,这就让有些人开始头疼了,而要查看具体的版本可以用以下命令 uname -r 当然,CentOS 6.8版本也能安装Docker ...

  3. Cent OS 6/7 中通过yum安装软件时提示cannot find a valid baseurl...的解决方法

    目录 1 问题描述 2 解决方法一 (Cent OS 7中有效) 3 解决方法二 (Cent OS 7中无效) 1 问题描述 新申请了虚拟机, 系统版本是Cent OS 7.2. 在安装软件的过程中, ...

  4. 安装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 ...

  5. 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 ...

  6. 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 ...

  7. 安装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 ...

  8. 安装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 ...

  9. 用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 ...

随机推荐

  1. Laravel 部署到阿里云 / 腾讯云

    首先你需要一台阿里云/腾讯云服务器 安装系统选择 ubuntu 16.04 然后通过 ssh 登录远程服务器按下列步骤进行配置: 更新列表 apt-get update 安装语言包 sudo apt- ...

  2. ThinkPHP中的时间自动填充 无法获取时间

    protected $_auto = array(       array('addTime','time','1','function'),    ); addTime在数据库里的的类型必须为int ...

  3. css的理解 ----footrt固定在底部

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  4. C语言程序设计100例之(28):直线蛇形阵

    例28        直线蛇形阵 问题描述 编写程序,将自然数1.2.….N2按蛇形方式逐个顺序存入N阶方阵.例如,当N=3和N=4时的直线蛇形阵如下图1所示. 图1  直线蛇形阵 输入格式 一个正整 ...

  5. 第二十篇 Linux条件测试语句相关知识点介绍

      条件测试语句的格式如下: [ 条件表达式 ]        # 条件表达式两侧各有一个空格 按测试对象不同,条件测试语句共分为4中类型: 文件测试语句 逻辑测试语句 整数值比较语句 字符串比较语句 ...

  6. DVWA全级别之SQL Injection(SQL注入)

    DVWA全级别之SQL Injection(注入)   DVWA简介 DVWA(Damn Vulnerable Web Application)是一个用来进行安全脆弱性鉴定的PHP/MySQL Web ...

  7. 前端之js基础篇

    JavaScript概述 ECMAScript和JavaScript的关系 1996年11月,JavaScript的创造者--Netscape公司,决定将JavaScript提交给国际标准化组织ECM ...

  8. yum grouplist 安装gnome桌面环境

      经常,我们如果需要安装一些比较复杂的软件时,都会在安装操作系统的时候直接勾选,然后进行安装.但是,有的时候,等操作系统安装完了才发现有遗漏的软件没有安装. 这个时候,yum就要出来救场了.使用yu ...

  9. idea选中文件时左侧菜单自动定位到文件所在位置

    一:设置成自动定位,如图: 二:点击项目工程目录上的阻击按钮,自动定位

  10. js中的日期控件My97 DatePicker

    使用WdatePicker插件来渲染日期类型的页面. 以下代码用到的属性有: isShowClear是否显示清空按钮 skin皮肤的样式 readOnly是否只读 maxDate:最大的选择时间 &l ...