当前位置: 首页 > news >正文

【解决】CentOS7 生命周期结束后 使用 yum命令报错问题

前言

天翼云服务器安装 centos7.9 使用yum命令报错,使用yum命令,报错信息如下:

[root@ecm-491c mysql-8.0.34]# yum -y update
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                    | 5.1 kB  00:00:00     * epel: ftp-stud.hs-esslingen.de
https://mirrors.tuna.tsinghua.edu.cn/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
正在尝试其它镜像。
To address this issue please refer to the below wiki article https://wiki.centos.org/yum-errorsIf above article doesn't help to resolve this issue please use https://bugs.centos.org/.One of the configured repositories failed (CentOS-7 - Base),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=base ...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 baseorsubscription-manager repos --disable=base5. 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 nicecompromise:yum-config-manager --save --setopt=base.skip_if_unavailable=truefailure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
https://mirrors.tuna.tsinghua.edu.cn/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found

问题原因

centos72024年6月30日,生命周期结束,官方不再进行支持维护,官方的YUM源也下线了,下线的方式是使yum的域名不解析。所以现在需要配置国内的YUM源。

解决办法

1. 编辑 CentOS-Base.repo

sudo vim /etc/yum.repos.d/CentOS-Base.repo

2. 将下文信息替换原有内容

[base]  
name=CentOS-$releasever - Base  
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/  http://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/  
gpgcheck=1  
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7  #released updates   
[updates]  
name=CentOS-$releasever - Updates  
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/  http://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/  
gpgcheck=1  
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7  #additional packages that may be useful  
[extras]  
name=CentOS-$releasever - Extras  
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/  http://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/  
gpgcheck=1  
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7  #additional packages that extend functionality of existing packages  
[centosplus]  
name=CentOS-$releasever - Plus  
baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/  http://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/  
gpgcheck=1  
enabled=0  
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7  #contrib - packages by Centos Users  
[contrib]  
name=CentOS-$releasever - Contrib  
baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/  http://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/contrib/$basearch/  
gpgcheck=1  
enabled=0  
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7  # 使用failovermethod指定优先级,这里设置为随机(roundrobin),也可以改为priority并指定每个URL的优先级  
failovermethod=roundrobin

3. 清理YUM缓存并更新

sudo yum clean all
sudo yum makecache
sudo yum update

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • 系统运维方案书(Word原件)
  • DNS部署与安全
  • esp8266根据httpserver状态,调用网络唤醒,实现一键开机
  • C++学习, 指针的指针
  • 5G智慧工地项目汇报方案
  • 深入理解Java序列化:从入门到实践
  • C++中函数重载的原理
  • vscode go开发环境
  • 硬盘的照片不小心删除怎么恢复 移动硬盘删除图片怎么恢复 数据恢复软件哪个好用
  • Apache Druid日志实时分析
  • 封装_私有类字段和方法
  • OpenCV绘图函数(6)绘制椭圆函数ellipse()的使用
  • 【C++设计模式】(三)创建型模式:单例模式
  • 构建智能化Web应用防火墙与自动化攻击测试系统
  • 医院建筑的电气设计——保障医疗质量与安全的坚固基石
  • Google 是如何开发 Web 框架的
  • @angular/forms 源码解析之双向绑定
  • Brief introduction of how to 'Call, Apply and Bind'
  • C++入门教程(10):for 语句
  • GDB 调试 Mysql 实战(三)优先队列排序算法中的行记录长度统计是怎么来的(上)...
  • Js实现点击查看全文(类似今日头条、知乎日报效果)
  • leetcode388. Longest Absolute File Path
  • php中curl和soap方式请求服务超时问题
  • Vue ES6 Jade Scss Webpack Gulp
  • Vue.js 移动端适配之 vw 解决方案
  • 前端
  • 使用iElevator.js模拟segmentfault的文章标题导航
  • 王永庆:技术创新改变教育未来
  • 新年再起“裁员潮”,“钢铁侠”马斯克要一举裁掉SpaceX 600余名员工 ...
  • ​必胜客礼品卡回收多少钱,回收平台哪家好
  • # 深度解析 Socket 与 WebSocket:原理、区别与应用
  • #NOIP 2014#Day.2 T3 解方程
  • #Z0458. 树的中心2
  • #大学#套接字
  • $.ajax()
  • (003)SlickEdit Unity的补全
  • (17)Hive ——MR任务的map与reduce个数由什么决定?
  • (6)STL算法之转换
  • (aiohttp-asyncio-FFmpeg-Docker-SRS)实现异步摄像头转码服务器
  • (DFS + 剪枝)【洛谷P1731】 [NOI1999] 生日蛋糕
  • (机器学习的矩阵)(向量、矩阵与多元线性回归)
  • (几何:六边形面积)编写程序,提示用户输入六边形的边长,然后显示它的面积。
  • (七)c52学习之旅-中断
  • (三)centos7案例实战—vmware虚拟机硬盘挂载与卸载
  • (转)从零实现3D图像引擎:(8)参数化直线与3D平面函数库
  • **Java有哪些悲观锁的实现_乐观锁、悲观锁、Redis分布式锁和Zookeeper分布式锁的实现以及流程原理...
  • ./configure,make,make install的作用(转)
  • .naturalWidth 和naturalHeight属性,
  • .net core 使用js,.net core 使用javascript,在.net core项目中怎么使用javascript
  • .Net Remoting常用部署结构
  • .NET版Word处理控件Aspose.words功能演示:在ASP.NET MVC中创建MS Word编辑器
  • :中兴通讯为何成功
  • @data注解_SpringBoot 使用WebSocket打造在线聊天室(基于注解)
  • @JsonSerialize注解的使用
  • @LoadBalanced 和 @RefreshScope 同时使用,负载均衡失效分析