ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

2022年5月22日亲测有效 解决 centos6.9 报错 YumRepo Error: All mirror URLs are not using ftp, http[s] or file.

2022-05-22 16:32:47  阅读:284  来源: 互联网

标签:ftp http CentOS centos releasever basearch 报错 YumRepo org


 环境 centos6.9

问题
CentOS 系统中出现YumRepo Error: All mirror URLs are not using ftp, http[s] or file.报错

Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Update Process
Determining fastest mirrors
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/repo/arch combination/
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base

原因
CentOS 6 于2020年11月30日停止维护,而Yum想要连接旧版本的仓库。所以,我们需要更新陈旧版本的仓库然后指向vault。

解决方案
为了解决这个问题,我们需要修改/etc/yum.repos.d/CentOS-Base.repo,然后替换掉所有镜像源。

1.进入到 /etc/yum.repos.d/目录

cd /etc/yum.repos.d/

2.备份原文件

cp CentOS-Base.repo CentOS-Base.repo.old

3.编辑新文件

vi CentOS-Base.repo

4.替换掉镜像源
将如下的sections都替换掉

[base]
[updates]
[extras]

替换为

[base]
name=CentOS-$releasever - Base
# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
# baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=https://vault.centos.org/6.10/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

# released updates
[updates]
name=CentOS-$releasever - Updates
# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
# baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
baseurl=https://vault.centos.org/6.10/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

# additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
# baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
baseurl=https://vault.centos.org/6.10/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

5.清理yum缓存

yum clean all

6.升级yum

yum update

问题解决啦!

转自:

(24条消息) 解决报错 YumRepo Error: All mirror URLs are not using ftp, http[s] or file._justinzwd的博客-CSDN博客

 感谢老哥。

标签:ftp,http,CentOS,centos,releasever,basearch,报错,YumRepo,org
来源: https://www.cnblogs.com/laterzh2022/p/16298159.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有