报错信息:

[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. bpftool使用方法简介

    1.安装bpftool工具 看起来,在不同的linux发行版里,bpftool在不同的软件包里,ubuntu 22上,bpftool是linux-tools-generic的一部分,而树莓派里bpft ...

  2. .Net 中带有 ? 的运算符

    // 带 ? 的表达式 // 1. 三元表达式 // 2. ?? 双问号 // obj1 ?? obj2 如果 obj1 为 空(null) 返回 obj2 // Configure the HTTP ...

  3. rancher发布nacos server docker 失败

    使用rancher发布nacos server 时报错 进入镜像查看日志发现报错No DataSource set 检查了好几遍环境变量已经全都配了,最后发现在nohup.out文件中指出没有找到na ...

  4. WebAssembly 基础以及结合其他编程语言

    0x00 WebAssembly 基础 详情参考<WebAssembly | MDN> (1)概述 WebAssembly 简称 WASM 或 WA,是一种新的编码方式,可以在现代的 We ...

  5. C#/.NET/.NET Core技术前沿周刊 | 第 9 期(2024年10.07-10.13)

    前言 C#/.NET/.NET Core技术前沿周刊,你的每周技术指南针!记录.追踪C#/.NET/.NET Core领域.生态的每周最新.最实用.最有价值的技术文章.社区动态.优质项目和学习资源等. ...

  6. flink同步MySQL数据的时候出现内存溢出

    flink同步MySQL数据的时候出现内存溢出 背景:需要将1000w的某类型数据同步到别的数据源里面,使用公司的大数据平台可以很快处理完毕,而且使用的内存只有很少很少量(公司的大数据平台的底层是fl ...

  7. 云原生周刊:Score 成为 CNCF 沙箱项目|2024.08.12

    开源项目推荐 KubeOne Kubermatic KubeOne 自动化管理您所有云环境.本地环境.边缘计算和物联网环境中的集群操作.KubeOne 可以安装高可用(HA)的主集群,也可以安装单主集 ...

  8. Value error: 'ascii' codec can't decode byte 0xe6 in position 26: ordinal not in range(128) The traceback for the exception was written to the log file

    原因:工作空间中有中文编码问题,导致的运行ros异常 解决办法: 1.解决urdf生成异常问题 urdf文件中不允许有中文,所有当输入中文的时候容易出问题,解决方案: ①在根目录下:/opt/ros/ ...

  9. spring boot下跨域安全配置

    1 @Bean 2 public FilterRegistrationBean corsFilter() { 3 final UrlBasedCorsConfigurationSource sourc ...

  10. P11233 CSP-S 2024 染色

    P11233 CSP-S 2024 染色 考试最后码方程忘记 \(a[i-1]\) 了,调不出来,只好 \(50pts\) 收尾. 思路 \(dp\) 的难点在于确定一段的颜色后,无法快速找到上一段相 ...