首页 > 编程学习 > 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

OVER.

Copyright © 2010-2022 ngui.cc 版权所有 |关于我们| 联系方式| 豫B2-20100000