配置YUM源出现Errno 14 Could not open/read repomd.xml 或者 "Couldn't open file /mnt/cdrom/repodata/repomd.xml" 错误的解决办法
报错信息:

[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" 错误的解决办法的更多相关文章
- linux配置yum源
yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能够从指定的服务器自动下载RP ...
- redhat 6 配置 yum 源的两种方法
由于 redhat的yum在线更新是收费的,如果没有注册的话不能使用,如果要使用,需将redhat的yum卸载后,重启安装,再配置其他源. 本文包括配置本地源及第三方源.第三方源包括:网易,epe ...
- CentOS / RHEL 配置yum源
CentOS / RHEL 配置yum源 */--> CentOS / RHEL 配置yum源 Table of Contents 1. 前言 2. 关于yum 2.1. yum是什么 2.2. ...
- RHEL 7.0 本地配置yum源
RHEL 7.0 本地配置yum源 yum简介 yum = Yellow dog Updater, Modified 主要功能是更方便的添加/删除/更新RPM包. 它能自动解决包的倚赖性问题. 它 ...
- CentOS7.1 JDK安装 和 CentOS7.1配置yum源
1.卸载自带OPENJDK #查看自身jdk java -verson #查看自身安装的java rpm -qa | grep java #显示如下 python-javapackages-3.4. ...
- 在redhat6下配置yum源的使用
有好多朋友使用linux redhat版本是不是还在为rpm包的安装而烦恼,yum工具的使用无意是解决这一难题的好工具,他可以解决包安装中依赖问题,但是对于redhat版本的系统来说如果 ...
- RedHat 6配置yum源为网易镜像(转)
概述 由于版权的问题,RedHat6不能直接使用yum一些指令,需要配置yum源为网易镜像,但是网上谈到很多:整理一下,将有用的信息整理如下,以便于能够为其他的配置服务配置使用:需要卸载掉原理系统自带 ...
- Linux 配置yum源.
Linux 配置yum源. 环境:虚拟机中安装了RedHat ,在进行安装mariadb的时候,出现如下错误.是因为yum源的问题,需要进行配置yum源.本教程是配置本地yum源. [root@loc ...
- redhat 配置yum源(配置163 yum repo)
一般安装好redhat后,不能注册的话,不能使用系统自带的yum源.但是我们可以自己配置yum源来解决这一问题.下面介绍下redhat配置163yum源. 1) 查看版本号和系统类别: cat /et ...
- 05: 配置yum源
1.1 将镜像复制到本地创建yum源 1.将准备好的系统镜像放到指定的目录,本次目录指定在:/dawnfs/sourcecode 2.创建挂载目录:mkdir /mnt/yum 3.挂载镜像: mou ...
随机推荐
- C# efcode 新建表格数据 增删改查
using TestDbContext ctx = new TestDbContext(); var b1 = new Book { AuthorName = "杨中科", Tit ...
- 为重复使用的HttpClient对象动态修改Timeout
最近博客园被**了, 赶紧水一文支持一下博客园,加油! 问题现象 当HttpClient被使用过之后, 在修改它们的属性会抛出错误This instance has already started o ...
- sort()的函数参数 —— function(a,b){return a -b} 相关问题_20220114
sort()的函数参数--function(a,b){return a -b} 相关问题 sort()的定义和用法 sort() 方法用于对数组的元素进行排序. 排序顺序可以是字母或数字,并按升序或降 ...
- 量子线路设计:减少CNOT和T门的意义。
在量子线路的设计中,我们往往希望减少线路中的CNOT门和T门的数目,原因如下: 一般文献宣称减少T门的数量是为了更高效地执行容错量子计算(fault-tolerant quantum computat ...
- OpenCV开发笔记(八十二):两图拼接使用渐进色蒙版场景过渡缝隙
前言 对于图像拼接,前面探讨了通过基于Stitcher进行拼接过渡和基于特征点进行拼接过渡,这2个过渡的方式是摄像头拍摄角度和方向不应差距太大. 对于特定的场景,本身摄像头拍摄角度差距较大,拉伸 ...
- 干货分享:开启PWM调光之门,一起来做呼吸灯
PWM作为一种灵活且高效的信号调制手段,在电气设备的性能控制和调节中发挥着重要作用,常用于电机控制.灯光调光.音频信号生成.加热控制等应用. 本文将以合宙低功耗4G模组经典型号--Air780E为例, ...
- 只有ip地址没有域名怎么申请https证书
只有IP地址没有域名,如何申请HTTPS证书? 在日常生活中,我们通常会为网站的域名申请HTTPS证书,以保护用户的数据安全.然而,有时候你可能需要为一个只有IP地址的服务或设备申请HTTPS证书. ...
- 【FAQ】HarmonyOS SDK 闭源开放能力 —Share Kit
1.问题描述: 使用系统分享组件分享本地文件,点击分享菜单下方的"另存为" 将要分享的文件分享至系统文件管理中,在文件管理中查看分享进来的文件为0B.尝试了3种uri的写法都不行, ...
- npm 发包命令
npm publish 此命令发布latest版本 npm publish --tag=alpha 发布alpha版本(测试版本) 紧急回退包方案: 分享一下bnpm给的处理方案 如果因为 ...
- 计算机概念——io 复用
前言 首先什么是io复用呢? 现在web框架没有不用到io复用的,这点是肯定的,不然并发真的很差. 那么io复用,复用的是什么呢?复用的真的不是io管道啥的,也不是io连接啥的,复用的是io线程. 这 ...