报错信息:

[root@tcljr-jdh-uat007 yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
file:///mnt/cdrom/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /mnt/cdrom/repodata/repomd.xml"
Trying other mirror. One of the configured repositories failed (xdn),
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=xdn ... 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 xdn
or
subscription-manager repos --disable=xdn 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=xdn.skip_if_unavailable=true failure: repodata/repomd.xml from xdn: [Errno 256] No more mirrors to try.
file:///mnt/cdrom/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /mnt/cdrom/repodata/repomd.xml"
[root@tcljr-jdh-uat007 yum.repos.d]# cd /mnt/repo
-bash: cd: /mnt/repo: No such file or directory

上述中的repodata/repomd.xml文件据说是/mnt目录rpm包的目录,路径

在/mnt中因为没有/repodata/repomd.xml 这个文件,所以提示出错,其实不是网上所说的软件库路径的问题。这也是明明在/mnt下看到我们要安装的包,而提示没有的缘故。

解决办法:

网上有各种办法:

第一种:解决办法就是把本地源关闭:将/etc/yum.repos.d/CentOS-Media.repo里面的enabled=1改成enabled=0即可,因为yum寻包的顺序应该先是本地源,再寻网络源。

第二种:解决方法就是重新配置生成repomd.xml文件。
以上述base为例,生成新的repomd.xml:

[root@yanta ~]# cd /mnt/repo

[root@yanta repo]# creatrepo ./base/

或许各自的实际情况不一样,上述方法并没有解决问题,经过一番验证后,发现另一种方法:通过一台正常服务器,获取yun源文件,然后替换该服务器yum源文件,结果正常了;

提供正常使用yum源文件:https://download.csdn.net/download/yang5726685/75666689

操作前可以先备份原有的yum源,然后替换即可,替换路径为:

/etc/yum.repos.d

清除缓存 生成新的缓存

yum clean all

yum makecache

最后,通过命令查看配置好的yum源是否正常:yum repolist。

配置YUM源出现Errno 14 Could not open/read repomd.xml 或者 "Couldn't open file /mnt/cdrom/repodata/repomd.xml" 错误的解决办法的更多相关文章

  1. linux配置yum源

    yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能够从指定的服务器自动下载RP ...

  2. redhat 6 配置 yum 源的两种方法

      由于 redhat的yum在线更新是收费的,如果没有注册的话不能使用,如果要使用,需将redhat的yum卸载后,重启安装,再配置其他源. 本文包括配置本地源及第三方源.第三方源包括:网易,epe ...

  3. CentOS / RHEL 配置yum源

    CentOS / RHEL 配置yum源 */--> CentOS / RHEL 配置yum源 Table of Contents 1. 前言 2. 关于yum 2.1. yum是什么 2.2. ...

  4. RHEL 7.0 本地配置yum源

    RHEL 7.0 本地配置yum源  yum简介  yum = Yellow dog Updater, Modified 主要功能是更方便的添加/删除/更新RPM包. 它能自动解决包的倚赖性问题. 它 ...

  5. CentOS7.1 JDK安装 和 CentOS7.1配置yum源

    1.卸载自带OPENJDK #查看自身jdk java -verson #查看自身安装的java  rpm -qa | grep java #显示如下 python-javapackages-3.4. ...

  6. 在redhat6下配置yum源的使用

           有好多朋友使用linux redhat版本是不是还在为rpm包的安装而烦恼,yum工具的使用无意是解决这一难题的好工具,他可以解决包安装中依赖问题,但是对于redhat版本的系统来说如果 ...

  7. RedHat 6配置yum源为网易镜像(转)

    概述 由于版权的问题,RedHat6不能直接使用yum一些指令,需要配置yum源为网易镜像,但是网上谈到很多:整理一下,将有用的信息整理如下,以便于能够为其他的配置服务配置使用:需要卸载掉原理系统自带 ...

  8. Linux 配置yum源.

    Linux 配置yum源. 环境:虚拟机中安装了RedHat ,在进行安装mariadb的时候,出现如下错误.是因为yum源的问题,需要进行配置yum源.本教程是配置本地yum源. [root@loc ...

  9. redhat 配置yum源(配置163 yum repo)

    一般安装好redhat后,不能注册的话,不能使用系统自带的yum源.但是我们可以自己配置yum源来解决这一问题.下面介绍下redhat配置163yum源. 1) 查看版本号和系统类别: cat /et ...

  10. 05: 配置yum源

    1.1 将镜像复制到本地创建yum源 1.将准备好的系统镜像放到指定的目录,本次目录指定在:/dawnfs/sourcecode 2.创建挂载目录:mkdir /mnt/yum 3.挂载镜像: mou ...

随机推荐

  1. yarn 和 npm 不能混合使用

    当有 yarn.lock 的时候说明项目使用的yarn 创建的 则后面的都要使用 yarn 操作,比如下载 包 等 : 当项目没有 yarn.lock 而是 package.json.lock 说明项 ...

  2. Vue-Router 是干什么的,原理是什么?

    传统的项目中,页面的切换和跳转使用的是超链接实现,但是目前的SPA 是基于组件和路由实现的,页面的切换和跳转是由路由机制完成,区别是更新了视图但不重新请求页面: 原理是把url 和组件之间建立映射关系 ...

  3. kotlin类与对象——>数据类、密封类、泛型

    数据类,用来保存数据的类,使用data对class进行标记 data class User(val name: String, val age: Int) //编译器自动从主构造函数中声明的所有属性导 ...

  4. 《使用Gin框架构建分布式应用》阅读笔记:p127-p142

    <用Gin框架构建分布式应用>学习第9天,p127-p142总结,总计16页. 一.技术总结 1.Authentication方式汇总 (1)API keys API keys 认证方式示 ...

  5. 鱼香ROS一键安装软件

    一行代码-解决人生烦恼 推荐语:一行代码搭建机器人开发环境(ROS/ROS2/ROSDEP) 开源地址:https://github.com/fishros/install 一键安装指令 wget h ...

  6. 利用jupyter进行股票数据分析

    1.需求:股票分析 使用tushare包获取某股票的历史行情数据. 输出该股票所有收盘比开盘上涨3%以上的日期. 输出该股票所有开盘比前日收盘跌幅超过2%的日期. 假如我从2010年1月1日开始,每月 ...

  7. SpringBoot学习 _02 _配置单数据源(1)

    SpringBoot学习 _02 _配置单数据源(1) 1.通过IDEA创建SpringBoot项目 直接到选择依赖这一步,选择如图所示的 五个依赖即可 2.配置文件的编写 此处说明一下,这个数据库连 ...

  8. 第八届御网杯线下赛Pwn方向题解

    由于最近比赛有点多,而且赶上招新,导致原本应该及时总结的比赛搁置了,总结来说还是得多练,因为时间很短像这种线下赛,一般只有几个小时,所以思路一定要清晰,我还是经验太少了,导致比赛力不从心,先鸽了~ S ...

  9. ABC 364

    ABC 364 E - Maximum Glutton 给定 \((a_i,b_i),X,Y\), 记 \(k\) 是第一个让 \(\sum_{i=1}^{k} a_i > X\) 或 \(\s ...

  10. cnblogs内容同步到51cto上的说明(声明)

    51CTO网站上的blog地址为:https://blog.51cto.com/u_15642578 该地址是个人在博客园cnblogs上的同步账号(https://cnblogs.com/xyz), ...