阿里云轻量级应用服务器yum安装git报错
yum install -y git
Error:
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-epel.repo; Configuration: OptionBinding with id "failovermethod" does not exist CentOS Linux 8 - AppStream 52 B/s | 38 B 00:00 Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
备份原有数据:
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo1 cp /etc/yum.repos.d/CentOS-AppStream.repo /etc/yum.repos.d/CentOS-AppStream.repo1
编辑如下文件:
vim /etc/yum.repos.d/CentOS-Base.repo
esc 键盘:命令模式下执行:(先按esc,然后冒号,然后执行下面的语句,这个语句是将mirrors.aliyun.com替换成mirrors.cloud.aliyuncs.com)
%s/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g
继续执行:
%s/$releasever/$releasever-stream/g vim /etc/yum.repos.d/CentOS-AppStream.repo
esc 键盘 : 命令模式下执行:
%s/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g
继续执行:
%s/$releasever/$releasever-stream/g
最后:
yum makecache yum update
附上阿里云原始文件(bk后缀)和修改后文件
感谢:
https://blog.csdn.net/weixin_44663675/article/details/122941582
https://blog.csdn.net/zhoupenghui168/article/details/123370719
留言评论
暂无留言