一、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命令了。
| |||||||||
日 | 一 | 二 | 三 | 四 | 五 | 六 | |||
---|---|---|---|---|---|---|---|---|---|
25 | 26 | 27 | 28 | 29 | 30 | 1 | |||
2 | 3 | 4 | 5 | 6 | 7 | 8 | |||
9 | 10 | 11 | 12 | 13 | 14 | 15 | |||
16 | 17 | 18 | 19 | 20 | 21 | 22 | |||
23 | 24 | 25 | 26 | 27 | 28 | 29 | |||
30 | 31 | 1 | 2 | 3 | 4 | 5 |
搜索
常用链接
随笔分类
随笔档案
- 2021年5月(1)
- 2021年4月(1)
- 2021年2月(1)
- 2021年1月(1)
- 2020年12月(1)
- 2020年8月(1)
- 2020年7月(2)
- 2020年6月(4)
- 2019年6月(1)
- 2018年12月(2)
- 2018年9月(4)
- 2018年3月(3)
- 2018年2月(1)
- 2018年1月(1)
- 2017年12月(1)
- 更多
文章分类
最新评论
- 1. Re:CentOS6 yum命令报错YumRepo Error: All mirror URLs are not using ftp, http[s] or file,修改yum源后404 Not Found
-
baseurl=
gpgkey=请问一下博主,这两个值中的6.1是值对应使用的CentOS的版本的吗?
- --思复诵
- 2. Re:使用SQL中的update更新多个字段值
-
谢谢分享
- --白白大黄小狐狸一只耳
- 3. Re:tomcat启动报错java.lang.OutOfMemoryError:PermGen space解决办法
- 有用,感谢
- --那画面丶太美
- 4. Re:tomcat启动报错java.lang.OutOfMemoryError:PermGen space解决办法
- 老哥给力呀,别的方法都试遍了都不行,你这种方法一下就好了,感谢!
- --居里先生
阅读排行榜
- 1. 使用SQL中的update更新多个字段值(97802)
- 2. mysql 使用service mysqld start 提示未识别服务 进入/etc/rc.d/init.d 下面未发现有mysqld解决方法(18383)
- 3. tomcat启动报错java.lang.OutOfMemoryError:PermGen space解决办法(13613)
- 4. CentOS6 yum命令报错YumRepo Error: All mirror URLs are not using ftp, http[s] or file,修改yum源后404 Not Found(5792)
- 5. centos7没有netstat命令的解决方法(1827)
评论排行榜
- 1. tomcat启动报错java.lang.OutOfMemoryError:PermGen space解决办法(2)
- 2. CentOS6 yum命令报错YumRepo Error: All mirror URLs are not using ftp, http[s] or file,修改yum源后404 Not Found(1)
- 3. 使用SQL中的update更新多个字段值(1)
推荐排行榜
- 1. 使用SQL中的update更新多个字段值(6)
- 2. CentOS6 yum命令报错YumRepo Error: All mirror URLs are not using ftp, http[s] or file,修改yum源后404 Not Found(2)
- 3. tomcat启动报错java.lang.OutOfMemoryError:PermGen space解决办法(1)
Copyright © 2021 开心萌小小
Powered by .NET 5.0 on Kubernetes Powered By博客园