项目问题 | CentOS 7停止维护导致yum失效的解决办法

devtools/2024/9/24 10:55:46/

目录

centos%E5%81%9C%E6%AD%A2%E7%BB%B4%E6%8A%A4%E6%84%8F%E5%91%B3%E7%9D%80yum%E7%9B%B8%E5%85%B3%E6%BA%90%E4%BC%B4%E9%9A%8F%E5%A4%B1%E6%95%88%E3%80%82-toc" style="margin-left:120px;">centos停止维护意味着yum相关源伴随失效。

报错:

linux%E7%B3%BB%E7%BB%9F%E3%80%82%E5%8F%82%E8%80%83%EF%BC%9ACentOS%E5%81%9C%E6%AD%A2%E7%BB%B4%E6%8A%A4%EF%BC%88EOL%EF%BC%89%E5%90%8E%E7%9A%84%E5%BA%94%E5%AF%B9%E6%96%B9%E6%A1%88_%E4%BA%91%E6%9C%8D%E5%8A%A1%E5%99%A8%20ECS(ECS)-%E9%98%BF%E9%87%8C%E4%BA%91%E5%B8%AE%E5%8A%A9%E4%B8%AD%E5%BF%83%20(aliyun.com)%E2%80%8B%E7%BC%96%E8%BE%91-toc" style="margin-left:120px;"> 解决方案:将图中四个文件替换掉/etc/yum.repos.d/目录下同名文件

 资源提交在博客头部,博客结尾也提供文件源码内容

CentOS-Base.repo

CentOS-SCLo-scl.repo

CentOS-SCLo-scl-rh.repo

epel.repo


2020 年,CentOS 项目与红帽联合宣布将全部投资转向 CentOS Stream,这是未来红帽企业 Linux 发行版的上游开发平台。因此,该项目在 2021 至 2024 年期间停止对 CentOS Linux 的更新和发布,直到 2024 年 6 月 30 日 CentOS Linux 7 的生命周期终止。

centos%E5%81%9C%E6%AD%A2%E7%BB%B4%E6%8A%A4%E6%84%8F%E5%91%B3%E7%9D%80yum%E7%9B%B8%E5%85%B3%E6%BA%90%E4%BC%B4%E9%9A%8F%E5%A4%B1%E6%95%88%E3%80%82">centos停止维护意味着yum相关源伴随失效。
报错:
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误"One of the configured repositories failed (未知),and yum doesn't have enough cached data to continue. At this point the onlysafe thing yum can do is fail. There are a few ways to work "fix" this:1. Contact the upstream for the repository and get them to fix the problem.2. Reconfigure the baseurl/etc. for the repository, to point to a workingupstream. This is most often useful if you are using a newerdistribution release than is supported by the repository (and thepackages for the previous distribution release still work).3. Run the command with the repository temporarily disabledyum --disablerepo=<repoid> ...4. Disable the repository permanently, so yum won't use it by default. Yumwill then just ignore the repository until you permanently enable itagain or use --enablerepo for temporary usage:yum-config-manager --disable <repoid>orsubscription-manager repos --disable=<repoid>5. Configure the failing repository to be skipped, if it is unavailable.Note that yum will try to contact the repo. when it runs most commands,so will have to try and fail each time (and thus. yum will be be muchslower). If it is a very temporary problem though, this is often a nice
▽       compromise:yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
linux%E7%B3%BB%E7%BB%9F%E3%80%82%E5%8F%82%E8%80%83%EF%BC%9ACentOS%E5%81%9C%E6%AD%A2%E7%BB%B4%E6%8A%A4%EF%BC%88EOL%EF%BC%89%E5%90%8E%E7%9A%84%E5%BA%94%E5%AF%B9%E6%96%B9%E6%A1%88_%E4%BA%91%E6%9C%8D%E5%8A%A1%E5%99%A8%20ECS(ECS)-%E9%98%BF%E9%87%8C%E4%BA%91%E5%B8%AE%E5%8A%A9%E4%B8%AD%E5%BF%83%20(aliyun.com)%E2%80%8B%E7%BC%96%E8%BE%91">解决方案:将图中四个文件替换掉/etc/yum.repos.d/目录下同名文件,包中文件重新配置了一些yum源获取的地址,替换后大部分都可以正常使用,但是难免可能会缺失其他包,建议尽快切换其它linux系统。
)
 资源提交在博客头部,博客结尾也提供文件源码内容。

参考:CentOS停止维护(EOL)后的应对方案_云服务器 ECS(ECS)-阿里云帮助中心 (aliyun.com)

CentOS-Base.repo
# 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 - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#released updates 
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

CentOS-SCLo-scl.repo
# CentOS-SCLo-sclo.repo
#
# Please see http://wiki.centos.org/SpecialInterestGroup/SCLo for more
# information[centos-sclo-sclo]
name=CentOS-7 - SCLo sclo
baseurl=http://vault.centos.org/centos/7/sclo/$basearch/sclo/
#mirrorlist=http://mirrorlist.centos.org?arch=$basearch&release=7&repo=sclo-sclo
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo[centos-sclo-sclo-testing]
name=CentOS-7 - SCLo sclo Testing
baseurl=http://buildlogs.centos.org/centos/7/sclo/$basearch/sclo/
gpgcheck=0
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo[centos-sclo-sclo-source]
name=CentOS-7 - SCLo sclo Sources
baseurl=http://vault.centos.org/centos/7/sclo/Source/sclo/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo[centos-sclo-sclo-debuginfo]
name=CentOS-7 - SCLo sclo Debuginfo
baseurl=http://debuginfo.centos.org/centos/7/sclo/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo

CentOS-SCLo-scl-rh.repo
# CentOS-SCLo-rh.repo
#
# Please see http://wiki.centos.org/SpecialInterestGroup/SCLo for more
# information[centos-sclo-rh]
name=CentOS-7 - SCLo rh
baseurl=http://vault.centos.org/centos/7/sclo/$basearch/rh/
#mirrorlist=http://mirrorlist.centos.org?arch=$basearch&release=7&repo=sclo-rh
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo[centos-sclo-rh-testing]
name=CentOS-7 - SCLo rh Testing
baseurl=http://buildlogs.centos.org/centos/7/sclo/$basearch/rh/
gpgcheck=0
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo[centos-sclo-rh-source]
name=CentOS-7 - SCLo rh Sources
baseurl=http://vault.centos.org/centos/7/sclo/Source/rh/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo[centos-sclo-rh-debuginfo]
name=CentOS-7 - SCLo rh Debuginfo
baseurl=http://debuginfo.centos.org/centos/7/sclo/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo

epel.repo
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
# It is much more secure to use the metalink, but if you wish to use a local mirror
# place its address here.
baseurl=http://download.example/pub/epel/7/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch&infra=$infra&content=$contentdir
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
# It is much more secure to use the metalink, but if you wish to use a local mirror
# place its address here.
baseurl=http://download.example/pub/epel/7/$basearch/debug
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch&infra=$infra&content=$contentdir
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
# It is much more secure to use the metalink, but if you wish to use a local mirror
# place it's address here.
baseurl=http://download.example/pub/epel/7/source/tree/
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch&infra=$infra&content=$contentdir
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1


http://www.ppmy.cn/devtools/98751.html

相关文章

零基础STM32单片机编程入门(三十九) 多传感器模块之NFC刷卡开门实战源码

文章目录 一.概要二.实验原理三.实验控制流程四.STM32单片机刷卡开门实验(RC522刷卡模块SG90舵机)五.CubeMX工程源代码下载六.实验效果七.小结 一.概要 NFC技术作为一种近距离无线通信技术&#xff0c;具有安全、便捷、高效的特点。随着智能手机的普及和移动支付的发展&#x…

k8s学习(三十八) 使用OpenTelemetry+jaeger实现链路追踪

文章目录 前言一、安装jaeger二、安装cert-manager三、安装OpenTelemetry Operator四、配置 OpenTelemetry Collector五、配置 Instrumentation六、编写java示例程序并测试调用链跟踪 前言 OpenTelemetry 可以用于从应用程序收集数据。它是一组工具、API 和 SDK 集合&#xff…

【CSP:202305-2】矩阵运算(Java)

题目链接 202305-2 矩阵运算 题目描述 求解思路 调整矩阵运算的顺序&#xff1a;根据矩阵运算符合结合律这一特点&#xff0c;对运算式的顺序进行调整。根据题目给出的数据范围&#xff0c;我们可以先将 K T ( d ∗ n ) K^T(d*n) KT(d∗n) 矩阵和 V ( n ∗ d ) V(n*d) V(n…

MySQL表涉及规范

MySQL表设计规范是为了确保数据库表结构的合理性、可读性和可维护性。以下是一些建议和规范&#xff1a; 1.使用InnoDB存储引擎&#xff1a;InnoDB存储引擎提供了事务支持、行级锁定和外键约束&#xff0c;有助于提高数据的完整性和性能。 2.表名和字段名命名规范&#xff1a…

苹果手机mov转mp4:一键转换,轻松享受!

视频凭借其直观生动的形式&#xff0c;已经深深融入我们的日常生活之中&#xff0c;成为我们记录生活、分享情感、学习娱乐的重要媒介。作为市场上最受欢迎的智能手机品牌之一&#xff0c;苹果手机以其卓越的拍摄性能&#xff0c;为用户捕捉了无数精彩瞬间&#xff0c;而其拍摄…

ACCESS 工具注入实战 凡诺靶场

简介 Access数据库注入攻击是一种常见的网络安全&#xff0c;通过注入SQL代码来获取未授权的数据访问权限。这种攻击利用了应用程序与数据库之间的交互漏洞&#xff0c;攻击者通过输入特定的SQL代码片段来操纵数据库查询&#xff0c;从而绕过应用程序的安全机制&#xff0c;获取…

haproxy编译安装

一、haproxy简介 HAProxy是一个使用C语言编写的自由及开放源代码软件&#xff0c;其提供高可用性、负载均衡&#xff0c;以及基于TCP和HTTP的应用程序代理。 HAProxy特别适用于那些负载特大的web站点&#xff0c;这些站点通常又需要会话保持或七层处理。HAProxy运行在当前的硬…

uniapp 地图map画出地市轮廓

最近做uniapp项目 H5微信小程序&#xff0c;需要在地图中打点并把相对应的区域轮廓给画出来。 首先查看uniapp官方文档&#xff1a;https://uniapp.dcloud.net.cn/component/map.html 想在uniapp中使用map直接写map标签即可 <view class"page-section page-section-…