在Docker安装Centos8的时候进入到容器安装Vim碰到以下问题:
Failed to set locale, defaulting to C.UTF-8
CentOS Linux 8 - AppStream 37 B/s | 38 B 00:01
Error: Failed to download metadata for repo ‘appstream’: Cannot prepare internal mirrorlist: No URLs in mirrorlist
解决方式如下:
#进入到centosYum源位置
cd /etc/yum.repos.d/
#修改该源位置下所有baseurl地址
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
#重新建立Yum缓存
yum makecache
#更新Yum源
yum update
#安装Vim
yum -y install vim