rhel8升级到openEuler时,由于elfutils-libelf被删除报错rebuild rpmdb error

升级时有如下错误:
“”"
[ INFO ] - [initramfs]: start to remove conflict rpm in sut.conf
[ INFO ] - [initramfs]: remove PackageKit-glib-1.1.12-3.el8.x86_64
[ INFO ] - [initramfs]: remove createrepo_c-libs-0.17.7-6.el8.x86_64
[ INFO ] - [initramfs]: remove elfutils-libelf-0.188-3.el8.x86_64
[ INFO ] - [initramfs]: start upgrade your system by dnf
[ ERROR ] - [initramfs]: rebuild rpmdb error
[ ERROR ] - [initramfs]: failed to upgrade system.
[ ERROR ] - [x2openEuler-upgrade] - failed to upgrade system
[ ERROR ] - [centos2openEuler]: Upgrade migrate failed
“”"

该问题是由于elfutils-libelf被删除导致rpm无法使用导致的,
处理方法:

  1. 把备份文件中libelf相关库copy到系统路径下,测试 rpm --help 是否正常
cp  /.osback/usr/lib64/libelf* /usr/lib64/
  1. 测试 dnf --help命令,若有报错:
    “”"
    Traceback (most recent call last):
    File “/usr/lib64/python3.6/site-packages/libdnf/error.py”, line 14, in swig_import_helper
    return importlib.import_module(mname)
    File “/usr/lib64/python3.6/importlib/init.py”, line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
    File “”, line 994, in _gcd_import
    File “”, line 971, in _find_and_load
    File “”, line 955, in _find_and_load_unlocked
    File “”, line 658, in _load_unlocked
    File “”, line 571, in module_from_spec
    File “”, line 922, in create_module
    File “”, line 219, in _call_with_frames_removed
    ImportError: libgnutls.so.30: cannot open shared object file: No such file or directory
    “”"
    则需要把libgnutils相关库copy到系统路径下
cp /.osbak/usr/lib64/libgnutls.so.30* /usr/lib64/
  1. 查看/etc/yum.repos.d/目录,删处其中非migrate 文件
    4.输入命令rpm -e --nodeps xxx重新删除日志中显示的冲突包,若有报错可忽略
    “”"
    [ INFO ] - [initramfs]: remove PackageKit-glib-1.1.12-3.el8.x86_64
    [ INFO ] - [initramfs]: remove createrepo_c-libs-0.17.7-6.el8.x86_64
    [ INFO ] - [initramfs]: remove elfutils-libelf-0.188-3.el8.x86_64
    “”"
    5.点击重试,即可正常升级
5 个赞

好贴必赞!

查看/etc/yum.repos.d/目录,删处其中非migrate 文件

这句没看明白

部分情况下,升级过程中会安装repo,这些repo和配置的repo不一致,会导致升级报错,需要手动删除