CentOS停止维护了,解决yum不能安装软件的问题

最近在使用CentOS的yum命令安装软件时,出现了如下错误:

原因:

这是因为CentOS在2024 年 6 月 30 日停止维护了,同时也移除了相关的软件镜像仓库,导致网站地址访问不了,从而下载不了软件。

解决方法:

bash 复制代码
#切换到yum.repos.d目录下
[root@root]# cd /etc/yum.repos.d    

查看该目录下的文件,如图显示原有的仓库文件,这些没有了,将他们全部删除

使用阿里云、腾讯云的yum源:

bash 复制代码
#阿里云的源
[root@192 yum.repos.d]# curl -o /etc/yum.repos.d/Centos-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

#腾讯云的源
[root@192 yum.repos.d]# curl -o /etc/yum.repos.d/epel.repo https://mirrors.cloud.tencent.com/repo/epel-7.repo

清除、更新yum缓存

bash 复制代码
#清除yum缓存
[root@192 yum.repos.d]# yum clean all

#更新yum缓存
[root@192 yum.repos.d]# yum makecache

等待下载完成就可以使用yum命令来安装软件了。

相关推荐
A小辣椒1 天前
TShark:Wireshark CLI 功能
linux
A小辣椒2 天前
TShark:基础知识
linux
AlfredZhao2 天前
OCI 明明分配了 200G 系统盘,为什么 df 只看到 30G?
linux·oci
AlfredZhao2 天前
vi 删除指定范围的行,不用再反复按 dd
linux·vi
用户9718356334663 天前
银河麒麟 KY10 申威(SW64) 安装 nginx-1.16.1-2.p01.ky10.sw_64.rpm 详细步骤
linux
猪脚踏浪3 天前
linux 拷贝文件或目录到指定的位置
linux
大树883 天前
金刚石散热越强,管路越先见顶
大数据·运维·服务器·人工智能·ai
摇滚侠3 天前
Linux CentOS7 rpm 安装 MySQL 5.7
linux·运维·mysql
霸道流氓气质3 天前
领域驱动设计(DDD)在 Spring Boot 微服务中的实践指南
运维·spring boot·微服务
bush43 天前
嵌入式linux学习记录十四、术语
linux·嵌入式