leapp post-upgrade task "yum remove kernel-workaround [...]" fails with "Problem: The operation would result in removing the following protected packages: dnf"
Environment
- Red Hat Enterprise Linux 7
- leapp
Issue
-
After upgrading the system from RHEL7 to RHEL8, the post-upgrade task below fails
# yum remove kernel-workaround $(rpm -qa | grep \.el7 | grep -vE 'gpgpubkey|libmodulemd|katello-ca-consumer') Updating Subscription Management repositories. Error: Problem: The operation would result in removing the following protected packages: dnf (try to add '--skip-broken' to skip uninstallable packages)
Resolution
Follow the procedure described in the Diagnostic Steps section.
If this is a match, proceed further, otherwise or if in doubt, open a case on the Customer Portal referencing this solution and upload an archive of the RPMDB for review (tar cf /tmp/rpmdb.tar /var/lib/rpm)
If you didn't upgrade the system yet, remove the EPEL7 libbrotli package from the system prior to executing leapp upgrade:
# yum remove libbrotli
The solution consists in removing the EPEL7 libbrotli package and install the expected brotli package as shown below:
# yum shell
[...]
> remove libbrotli
> install brotli
> run
[...]
Root Cause
-
On the RHEL7 system, EPEL's libbrotli ships
/usr/lib64/libbrotlicommon.so.1 -
When executing leapp, the yum transaction for the user space downloads all RHEL8 packages, including dnf
-
dnf requires python3-libdnf which internally requires
/usr/lib64/libbrotlicommon.so.1
Hence, because the library is already present on the system, the yum transaction doesn't automatically selects brotli package, but continues with libbrotli from EPEL, which hence remains on the system after the upgrade.
Diagnostic Steps
-
Verify that libbrotli is installed on the system
# rpm -qa | grep libbrotli libbrotli-1.0.9-10.el7.x86_64
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.