zoukankan      html  css  js  c++  java
  • 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命令了。

              

  • 相关阅读:
    Redis学习笔记之一 : 配置redis
    Web 项目更改项目名
    Linux 常用命令之一
    SQL 常用语法一
    Java http请求和调用
    Spring c3p0连接池无法释放解决方案
    Windows和Linux查看和更改mysql连接池
    Java 简单实用方法二
    Linux 更改ssh 端口
    CentOS 通过yum安装web环境
  • 原文地址:https://www.cnblogs.com/pistachio123/p/14301949.html
Copyright © 2011-2022 走看看