YumRepo Error_ All mirror URLs are not using ftp, http[s] or file. Eg. Invalid release_repo_arch co

一、背景

继 CentOS 8 停维后 CentOS 7 也将停止维护!
CentOS 8 2021年底停止维护,CentOS 6 2020年底停止维护,CentOS 7 也已于 2020 年底结束整体性更新,暂定计划于 2024 年 6 月底结束维护性更新,CentOS 全系即将迎来生命的终点。

CentOS 停服后我们可以考虑使用免费的 CentOS Stream 或使用收费的 RHEL
如果不担心数据安全、系统 BUG 无人修复等问题也可以继续使用 CentOS 旧版(不推荐)
当然也可以更大胆一些直接迁移到其他 Linux 系统上,例如:

Rocky Linux(CentOS创始人对红帽停更不满而开发的)

Ubuntu

AlmaLinux

Alibaba Cloud Linux 等

二、如何解决问题

All mirror URLs are not using ftp, http[s] or file. Cannot find a valid baseurl for repo: base
20201205 centos6 20201130 停止维护了 官方源已经没有用了 镜像源也肯定没用了
YUM报错那是肯定的!!!
解决方法:
新的源: mirrors.aliyun.com/centos-vault
修改 /etc/yum.repos.d 中的 CentOS-Base.repo
1.注释所有的 mirrorlist= #mirrorlist=
2.取消所有的 baseurl 注释
3.将 baseurl 中的mirrorlist.centos.org/centos改为 mirrors.aliyun.com/centos-vault

将mirrorlist注释掉,启用baseurl。我的修改成下面这个样子,要注意baseurl要修改成自己centos的版本号,我的是6.7
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#

[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=http://mirrors.aliyun.com/centos-vault/6.7/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=http://mirrors.aliyun.com/centos-vault/6.7/os/$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=http://mirrors.aliyun.com/centos-vault/6.7/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
baseurl=http://mirrors.aliyun.com/centos-vault/6.7/os/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
baseurl=http://mirrors.aliyun.com/centos-vault/6.7/os/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
更新后需要重新设置,使修改后的资源生效。

1.清除yum缓存

yum clean all

2.删除yum缓存文件

rm -rf /var/cache/yum/

3.重新创建yum缓存,这里注意系统时间要与因特网一致

yum makecache

现在可以成功安装了

在这里插入图片描述

各位看官》创作不易,点个赞!!!
诸君共勉:万事开头难,只愿肯放弃。

免责声明:本文章仅用于学习参考

  • 5
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值