首页 > 系统相关 >配置YUM源出现Errno 14 Could not open/read repomd.xml 或者 "Couldn't open file /mnt/cdrom/repodata

配置YUM源出现Errno 14 Could not open/read repomd.xml 或者 "Couldn't open file /mnt/cdrom/repodata

时间:2022-12-28 03:55:05浏览次数:63  
标签:xml repodata repository mnt repomd yum open

报错信息:

复制代码
[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。

标签:xml,repodata,repository,mnt,repomd,yum,open
From: https://www.cnblogs.com/exmyth/p/17009341.html

相关文章

  • 参加MVP OpenDay 和2015 MVP Community Camp社区大课堂
    微软MVPOpenday1月30日在北京召开,到时全国上百位MVP专家将齐聚北京。当然还有亚太的其他国家地区的MVP也会来北京,1月31日微软MVP项目组主办的年度微软技术社区分享大......
  • OpenCV图像旋转,指定填充背景颜色边界颜色
    OpenCV图像旋转,指定填充背景颜色边界颜色OpenCV与图像旋转有关的函数:(1)warpAffine函数INTER_LINEARBORDER_CONSTANTScalar()中文解释:  C++:voidwarpAffine(InputArray......
  • AnswerOpenCV(1001-1007)一周佳作欣赏
    一、小白问题​​http://answers.opencv.org/question/199987/contour-single-blob-with-multiple-object/​​ContourSingleblobwithmultipleobjectHit......
  • wininet https请求——不使用openssl也是可以的
     //WinINetHTTPSGet//https请求:https://github.com/netdata/netdata/blob/master/CMakeLists.txt#include<iostream>#include<Windows.h>#include<WinInet.h>......
  • OpenCV-Python learning-7.运算性能
    本节说明opencv-python对于性能的度量和优化。以下为代码部分:%matplotlibinlineimportcv2importmatplotlib.pyplotaspltimg=cv2.imread('e:/rotman.jpg')plt.imshow(......
  • 关于python环境中安装OpenSSL模块报错-ERROR: Could not find a version that satisfi
    因为需要在代码中importOpenSSL,笔者就准备使用pip3install的方式安装 OpenSSL,结果报如下错误:[qq5201351@localhost~]$pip3installOpenSSLERROR:Couldnotfi......
  • 浅析OpenCV中的BlobDetector
    ​​​​一、blob基础所谓Blob就是图像中一组具有某些共同属性(例如,灰度值)的连接像素。在上图中,深色连接区域是斑点,斑点检测的目的是识别并标记这些区域。OpenCV提供了一......
  • OpenCV中轮廓处理简介
    一、OpenCV中的轮廓图像的上半部分是一张白色背景上的测试图像,包含了一系列标记A到E的区域。寻找到的轮廓被标记为cX或hX,其中c代表“轮廓(contour)”,h代表“孔(h......
  • GreenOpenPaint的实现(一)基本框架
    Win7下的MSPaint是Ribbon的典型运行。这种SDI程序对于图像处理来说是很适合的。利用春节时间,基于之前的积累,我实现GreenOpenPaint,主要就是模拟MSPaint的界面,实现出现处理的......
  • 玩转OpenHarmony智能家居:如何实现树莓派“碰一碰”设备控制
    一、简介“碰一碰”设备控制,依托NFC短距通信协议,通过碰一碰的交互方式,将OpenAtomOpenHarmony(简称“OpenHarmony”)标准系统设备和全场景设备连接起来,解决了应用与设备之间接......