CentOS7简化版的yum源问题解决
文章标签:
Linux
如题。
本次在安装和使用CentoOS7简化版的时候,再一次的遇到了yum源无法使用的问题,如下图所示:
提示:类似的问题,也可以参考之前的:https://www.shaoxiaodan.com.cn/?id=82
0. yum执行安装git失败!!
# 安装git失败! yum install -y git
# 查看命令,列出yum所有可用的源 yum repolist all
另外,我也发现了和以往不一样的【奇怪问题】:
1. wget命令没有找
这个问题是我在准备替换并更新yum源的时候,出现了wget命令无法找到的错误提示。
# 注意,wget无法正常执行! wget -O /etc/yum.repos.d/CentOS-Base.repo HTTPS://mirrors.aliyun.com/repo/Centos-7.repo
解决方法:
# 用curl命令替代 curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
如果出现如下所示结果,就说明了yum源的替换执行成功!
然后,就和以前一样,执行如下两条命令:
yum clean all #清理缓存 yum makecache #设置缓存
执行结果,分别如下:
此时,重新执行git的安装命令:
yum install -y git
先去安装软件所必要的库
然后再去安装git
自此,问题解决。
参考资料来源:
https://developer.aliyun.com/mirror/centos
https://huaweicloud.csdn.net/63563a79d3efff3090b5b5c5.html
https://blog.csdn.net/shanvlang/article/details/144065229










