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

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

前言

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

[root@ecm-xxx 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-errors

If 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 only
 safe 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 working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=base ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable base
        or
            subscription-manager repos --disable=base

     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 much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=base.skip_if_unavailable=true

failure: 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


http://www.kler.cn/a/287085.html

相关文章:

  • 在K8S中,如果后端NFS存储的IP发送变化如何解决?
  • Java 的初认识(一)
  • (10)深入浅出智能合约OpenZeppelin开源框架
  • SDL2:Android APP编译使用 -- SDL2多媒体库使用音频实例
  • PyTorch使用教程(9)-使用profiler进行模型性能分析
  • k8s集群换IP
  • assert()在solidity的运用,模糊测试案例
  • 【C++】vector(下)--下篇
  • prometheus基于文件的服务发现
  • 百日草花语探秘:天长地久的情感寄托与丰富内涵解析
  • 基于Virtex UltraScale+ VU13P FPGA的4路FMC接口基带信号处理平台
  • Python测试之测试覆盖率统计
  • Linux:SQLite 数据库
  • 安卓13 鼠标右键作返回键,鼠标事件修改
  • Vidda电视X Ultra等加入能效补贴,京东天猫可买量大管饱
  • 【验证码逆向专栏】某某滑块逆向分析
  • Java常见设计模式
  • 第二证券:三大因素将共同推动悲观情绪修复 风格阶段性趋于平衡
  • 【算法】二分查找
  • ARM32开发——(二十一)ADC系统工作原理
  • MobaXterm 终端工具使用
  • 【JVM】执行引擎、JIT、逃逸分析(二)
  • SQLite3 数据库
  • 【Python机器学习】NLP分词——词的“情感”
  • 力扣1353.最多可以参加的会议数目
  • 集成电路学习:什么是FPGA现场可编程门阵列