Centos8出现No module named ‘librepo’

CentOS 8 停止更新?应对错误提示:Failed to download metadata for repo ‘appstream’和
Module yaml error: Unexpected key in data: static_context [line 9 col 3]。
最近操作VPS时出现:

Failed loading plugin "osmsplugin": No module named 'librepo'

然后尝试自己安装:

dnf install **python3-librepo**
Failed loading plugin "osmsplugin": No module named 'librepo'
CentOS Linux 8 - AppStream                                                                               82  B/s |  38  B     00:00    
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

手动转换CentOS Stream 8

结果去GOOGLE了一下,发现CentOS 8已经停止更新了,官方说自己手动转换成CentOS Stream 8,才可以继续正常操作。
如何转换呢,其实两条命令就可以了:
20220709172526.webp

dnf --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos

sudo dnf distro-sync

安装python3-librepo

然后再来操作:

dnf install **python3-librepo**

yum update

再来 yum update ,就再也没有错误提示啦。

但是我执行 yum update时出现如下错误:

Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Error:
 Problem: package lua-devel-5.3.4-11.el8.x86_64 requires lua(x86-64) = 5.3.4-11.
  - cannot install both lua-5.3.4-12.el8.x86_64 and lua-5.3.4-11.el8.x86_64
  - cannot install the best update candidate for package lua-5.3.4-11.el8.x86_64
  - problem with installed package lua-devel-5.3.4-11.el8.x86_64
(try to add '--allowerasing' to command line to replace conflicting packages or st' to use not only best candidate packages)

dnf upgrade libmodulemd

可以通过升级 libmodulemd 解决。该问题已在 libmodulemd-2.13.0-1.fc33 中修复。

dnf upgrade libmodulemd

Is this ok [y/N]: y

重建缓存

yum clean all
rpm --rebuilddb
yum update
yum list
yum makecache
© 版权声明
THE END
如果喜欢,可以【点赞】【分享】【收藏】
点赞7赞赏 分享
评论 抢沙发
头像
非注册用户需审核通过后才能查看。友好交流,勿发纯表情,勿恶意灌水!
提交
头像

昵称

取消
昵称表情代码图片
    • 头像h0