2021-05-28

​​​​

CentOS6 yum命令报错YumRepo Error: All mirror URLs are not using ftp, http[s] or file,修改yum源后404 Not Found

一、CentOS6 yum命令报错YumRepo Error: All mirror URLs are not using ftp, http[s] or file

1、网上有些人说是/etc/yum.repos.d/CentOS-Base.repo这个文件的配置问题,注释掉mirrorlist这个配置项就能成功,试下看看

 mirrorlist都注释掉了,还是报错,但是报错信息不是All mirror URLs are not using ftp, http[s] or file.了,而是404 not find

后来猜想,应该是配置中的链接访问不了,然后把baseurl这个配置的链接去浏览器访问,果然是404,原来是这个外国网站挂了。

2、修改yum源:尝试如下各种方法

方法1)、把源站点配置改为国内清华大学站点https://mirrors.tuna.tsinghua.edu.cn/centos-vault

             修改yum源站点配置:vi /etc/yum.repos.d/CentOS-Base.repo

             对照清华大学镜像站中的目录修改后如下:

            

           

          执行yum install openssh-clients,仍报错404 not found

方法2)、更新yum源为aliyun源

         步骤1、更新yum源:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
               (Centos7为:wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
         步骤2、自动加载一下在线更新源:yum list  仍然报错

后来才知道:CentOS6已经在2020年11月30日停止维护了。centos官方停止了对centos6的所有更新,并且下架了包括官方所有的centos6源,目前阿里、163、清华等centos6源已无法使用。

 更新源还是404错误

二、修改yum源后404 Not Found解决方法:

备份配置文件,防止以后出错后不好恢复

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

执行下面命令,新建CentOS-Base.repo配置:

vim /etc/yum.repos.d/CentOS-Base.repo

复制粘贴如下命令

[centos-office]
name=centos-office
failovermethod=priority
baseurl=https://vault.centos.org/6.10/os/x86_64/
gpgcheck=1
gpgkey=https://vault.centos.org/6.10/os/x86_64/RPM-GPG-KEY-CentOS-6

保存后退出

执行yum list  正常无报错

此时即可正常使用yum命令了。

<2021年5月>
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345

搜索

 

 

常用链接

随笔分类

随笔档案

文章分类

最新评论

阅读排行榜

评论排行榜

推荐排行榜

Copyright © 2021 开心萌小小
Powered by .NET 5.0 on Kubernetes Powered By博客园

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值