问题描述
在CentOS8上面用yum安装git的时候遇到如下问题:
[vagrant@192.168.38.4] ~ >> sudo yum install git
CentOS Linux 8 - AppStream 71 B/s | 38 B 00:00
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
尝试利用换镜像源的方案没有作用
linux 为 repo ‘AppStream’ 下载元数据失败
解决方案
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*
如果想要更新centos8:
sudo dnf install centos-release-stream -y
sudo dnf swap centos-{linux,stream}-repos -y
sudo dnf distro-sync -y
特此记录