字节笔记本字节笔记本

解决 Failed loading plugin osmsplugin No module named 'librepo'

2022-04-02

解决 "Failed loading plugin 'osmsplugin': No module named 'librepo'" 错误的方法是安装 `python3-librepo`,并建议迁移到 CentOS Stream 8 或选择其他替代发行版以解决更新问题。

运行:

yum update 

报错:

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

修复:

sudo dnf install python3-librepo

更新源

Error: Failed to download metadata for repo ‘appstream’

If you still manage system’s running CentOS 8 and you attempt to update packages using dnf update or yum update, you will encounter the following error:

Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

Solution: Migrate to CentOS Stream 8 or an alternative distro

Now that CentOS has shifted to Stream – a rolling-release Linux distribution, midstream between the upstream development in Fedora and the downstream development for RHEL – many users are moving to CentOS alternatives. Others have decided to stick with CentOS by migrating to CentOS Stream 8. Both of these choices will resolve not being able to update CentOS 8.

To migrate from CentOS 8 to CentOS Stream 8, run the following commands:

dnf --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos
dnf distro-sync
dnf --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos
Failed to set locale, defaulting to C.UTF-8
Failed loading plugin "osmsplugin": No module named 'librepo'
Last metadata expiration check: 0:00:11 ago on Sat Apr  2 03:56:09 2022.
Dependencies resolved.