Module yaml error: Unexpected key in data: static_context
CentOS8下执行yum install xxx 时出现以上错误,解决措施如下:
1、将旧镜像库文件备份
cd /etc/yum.repos.d
mkdir ~/repo_old
mv ./* ~/repo_old/
cp ~/repo_old/CentOS-Linux-BaseOS.repo .
cp ~/repo_old/CentOS-Linux-AppStream.repo .
2、修改镜像地址为vault
BaseOS.repo
vim CentOS-Linux-BaseOS.repo
#修改
baseurl=https://vault.centos.org/centos/$releasever/BaseOS/$basearch/os/
AppStream.repo
vim CentOS-Linux-AppStream.repo
#修改
baseurl=https://vault.centos.org/centos/$releasever/AppStream/$basearch/os/
3、 重建缓存
yum clean all
rpm --rebuilddb
yum update
yum list
yum makecache
1、将旧镜像库文件备份
cd /etc/yum.repos.d
mkdir ~/repo_old
mv ./* ~/repo_old/
cp ~/repo_old/CentOS-Linux-BaseOS.repo .
cp ~/repo_old/CentOS-Linux-AppStream.repo .
2、修改镜像地址为vault
BaseOS.repo
vim CentOS-Linux-BaseOS.repo
#修改
baseurl=https://vault.centos.org/centos/$releasever/BaseOS/$basearch/os/
AppStream.repo
vim CentOS-Linux-AppStream.repo
#修改
baseurl=https://vault.centos.org/centos/$releasever/AppStream/$basearch/os/
3、 重建缓存
yum clean all
rpm --rebuilddb
yum update
yum list
yum makecache