文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

【Linux_Cent OS】yum错误:failure: repodata/repomd.xml from local: [Errno 256] No more mirrors to try.

2023-10-09 12:48

关注

问题再现

近期在学习Linux,发现在学习yum时,进行一些必要操作,总会出现该错误。
failure: repodata/repomd.xml from local: [Errno 256] No more mirrors to try. file:///mnt/ios/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /mnt/ios/repodata/repomd.xml"

问题yum

解决

问题截图

删除老的仓库

rm /etc/yum.repos.d/*.*
删除老仓库

卸载yum

 [root@centos7-9-2009-zsc yum.repos.d]# rpm -qa yum yumyum-3.4.3-168.el7.centos.noarch[root@centos7-9-2009-zsc yum.repos.d]# rpm -qa yum yum-3.4.3-168.el7.centos.noarchyum-3.4.3-168.el7.centos.noarch[root@centos7-9-2009-zsc yum.repos.d]# rpm -qa | grep yum | xargs rpm -e --nodeps警告:/etc/yum/pluginconf.d/langpacks.conf 已另存为 /etc/yum/pluginconf.d/langpacks.conf.rpmsave[root@centos7-9-2009-zsc yum.repos.d]# rpm -qa yum yum-3.4.3-168.el7.centos.noarch[root@centos7-9-2009-zsc yum.repos.d]# rpm -qa | grep yum | xargs rpm -e --nodepsrpm:未给出要擦除的软件包[root@centos7-9-2009-zsc yum.repos.d]# rpm -qa yum[root@centos7-9-2009-zsc yum.repos.d]# ls[root@centos7-9-2009-zsc yum.repos.d]# 

rpm -qa yum没有提示表明已删除
操作

下载rpm包

可下载最新的。

[root@centos7-9-2009-zsc ~]# ls anaconda-ks.cfg       myresult yum-3.4.3-168.el7.centos.noarch.rpm         yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm  模板  图片  下载  桌面initial-setup-ks.cfg  print    yum-metadata-parser-1.1.4-10.el7.x86_64.rpm  公共                       视频  文档  音乐 

在这里插入图片描述

下载地址

下载地址

下载内容

下载三项:在这里插入图片描述

并将其传至centOS

在这里插入图片描述

接下来,进行安装rpm

rpm -ivh yum-*
install

进行检查(养成好习惯)

在这里插入图片描述

检查方式二

在这里插入图片描述

导入证书

[root@centos7-9-2009-zsc ~]# rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7

在这里插入图片描述

配置阿里源

在这里插入图片描述

[root@centos7-9-2009-zsc ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo--2022-10-23 10:16:39--  http://mirrors.aliyun.com/repo/Centos-7.repo正在解析主机 mirrors.aliyun.com (mirrors.aliyun.com)... 27.128.147.239, 27.128.147.234, 27.128.147.237, ...正在连接 mirrors.aliyun.com (mirrors.aliyun.com)|27.128.147.239|:80... 已连接。已发出 HTTP 请求,正在等待回应... 200 OK长度:2523 (2.5K) [application/octet-stream]正在保存至: “/etc/yum.repos.d/CentOS-Base.repo”100%[===============================================================================================================================================>] 2,523       --.-K/s 用时 0s      2022-10-23 10:16:39 (920 MB/s) - 已保存 “/etc/yum.repos.d/CentOS-Base.repo” [2523/2523])

下一步,进行清缓存

[root@centos7-9-2009-zsc ~]# yum clean all已加载插件:fastestmirror正在清理软件源: base extras updatesCleaning up list of fastest mirrors

最后生成/制作出新的缓存

[root@centos7-9-2009-zsc ~]# yum makecache已加载插件:fastestmirrorDetermining fastest mirrors * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.comhttp://mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; 拒绝连接"正在尝试其它镜像。http://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.cloud.aliyuncs.com; 未知的错误"正在尝试其它镜像。base                  | 3.6 kB  00:00:00     extras                | 2.9 kB  00:00:00     updates               | 2.9 kB  00:00:00     (1/10): base/7/x86_64/group_gz                    | 153 kB  00:00:00     (2/10): base/7/x86_64/primary_db                  | 6.1 MB  00:00:06     (3/10): extras/7/x86_64/primary_db                | 249 kB  00:00:00     (4/10): extras/7/x86_64/filelists_db              | 276 kB  00:00:00     (5/10): extras/7/x86_64/other_db                  | 149 kB  00:00:00     (6/10): base/7/x86_64/other_db                    | 2.6 MB  00:00:02     (7/10): updates/7/x86_64/filelists_db             | 9.6 MB  00:00:10     (8/10): updates/7/x86_64/other_db                 | 1.2 MB  00:00:01     (9/10): base/7/x86_64/filelists_db                | 7.2 MB  00:00:23     (10/10): updates/7/x86_64/primary_db              |  17 MB  00:00:18     元数据缓存已建立

在这里插入图片描述

以上步骤操作完成后,我们进行前后对比

就不会再报错啦~~~

重新安装后

后的效果图

之前报错~~~

前

对比
[root@centos7-9-2009-zsc ~]# yum check-update -y dialog已加载插件:fastestmirror, langpacksLoading mirror speeds from cached hostfilefile:///mnt/ios/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /mnt/ios/repodata/repomd.xml"正在尝试其它镜像。 One of the configured repositories failed (local), 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=local ...     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 local        or            subscription-manager repos --disable=local     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=local.skip_if_unavailable=truefailure: repodata/repomd.xml from local: [Errno 256] No more mirrors to try.file:///mnt/ios/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /mnt/ios/repodata/repomd.xml"

failure: repodata/repomd.xml from local: [Errno 256] No more mirrors to try. file:///mnt/ios/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /mnt/ios/repodata/repomd.xml"

[root@centos7-9-2009-zsc ~]# yum check-update -y dialog已加载插件:fastestmirrorLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.com[root@centos7-9-2009-zsc ~]# 

已加载插件:fastestmirror Loading mirror speeds from cached hostfile
*base: mirrors.aliyun.com
*extras: mirrors.aliyun.com
*updates: mirrors.aliyun.com

这次错误学习纠正就到这里啦~

我们下次再见 最后别忘记点赞关注+收藏呀~~

来源地址:https://blog.csdn.net/weixin_52372189/article/details/127471149

阅读原文内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     813人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     354人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     318人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     435人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     224人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-人工智能
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯