报错信息:

[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. Android内存分析命令

    一.内存指标 Item 全称 含义 等价 USS Unique Set Size 物理内存 进程独占的内存 PSS Proportional Set Size 物理内存 PSS= USS+ 按比例包含 ...

  2. Ewald求和在分子静电势能计算中的应用

    技术背景 分子动力学模拟中,计算周期性边界条件的静电势常被视作计算的瓶颈之一.形式上是比较容易的,例如不考虑周期性边界条件的话,静电势能就是: \[E=\frac{1}{4\pi\epsilon_0} ...

  3. webapi action 参数

    使用地址参数传递(queryString)数据:eg:http://localhost:5063/WeatherForecast?age=123 /// <summary> /// GET ...

  4. Android复习(一)基础知识

    1. 现在可以使用 Kotlin.Java 和 C++ 语言编写 Android 应用 2.Android四大组件依然坚挺,这是基础并且没有改变的迹象 Activity 服务 广播接收器 内容提供程序 ...

  5. 《你不知道的JavaScript》读书笔记(一):JS是如何查找变量的

    这本书之前囫囵地看了一遍,确实点明了很多以前不清不楚的点,但是仅仅看一遍是没什么用的,最近面试遇到不少原理相关的题感觉答得不理想,回头看下其实以前都理解过,但是没有记下来,正好结合实际的问题来再学习一 ...

  6. 云原生周刊 | 在 Grafana 中显示 K8s Service 之间的依赖关系

    开源项目推荐 Caretta 这个项目可以在 Grafana 监控面板中显示 K8s Service 之间的依赖关系.底层使用的是 eBPF,对应用无侵入. busuanzi 这是一个基于 Golan ...

  7. cxv文件合并

    1.新建bat脚本 @echo off setlocal enabledelayedexpansion copy *.csv new.csv echo @@@@@@@@@@@@@合并成功!@@@@@@ ...

  8. SpringBoot入门到精通(十三)日志:别小看它,否则吃亏的是自己!学会你也可以设计架构

    别小看他,当你面对的时候,就会知道,多么痛的领悟! 如何在 Spring Boot 中使用 Logback 记录详细的日志? 整合LogBack,Log4J...等,是不是很多方法!但需要注意,我讲的 ...

  9. C++ 加权随机抽样

    ​ 在做五子棋 AI 的时候,遇到要根据权重从一组数里边随机选出一个这个问题.这个问题恰好也是 leetcode 第 528 道题,使用 C++,标准库就有现成的: #include <rand ...

  10. att&ack框架学习笔记5

    深度解读ATT&CK框架前言:在上一篇文章中,我们简单介绍了这个由美国研究机构MITRE于2014年推出的新型攻击框架ATT&CK的相关概念.ATT&CK是将已知攻击者的行为汇 ...