Loading... ### 简话短说 一些情况下,用到的软件可能版本过就损坏甚至没装,也正好原来的系统软件源没有这个软件或者没更新,没法正常安装上需要的软件 本篇文章用到阿里镜像站:https://developer.aliyun.com/mirror/ 你也可以用其他的镜像站,如中科大,北大,华为,163等等,有用到的软件包就行 ### 正经操作 #### 安装wget指令 wget用于下载远程文件 ```shell yum install -y wget ``` #### 备份旧仓库源(软件源) ```shell cd /etc/yum.repos.d mkdir /reposss ##创建文件夹 mv *.repo /reposss ##移动备份文件到reposss下 ```  #### 清理旧的包 ```shell yum clean all ``` #### 下载新的源仓和epel ```shell wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo ```  #### 加载缓存 更新yum源 ```shell yum makecache yum update ``` 等待全部加载完就行,有选项的话可以选y,过程可能会有点久。 ### 安装 完成后就可以直接用yum来安装需要用到的软件了 最后修改:2024 年 08 月 30 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 觉得文章有用,可以赞赏请我喝瓶冰露