Leapp In-Place Upgrade: how to check DNF is working with the Satellite repositories from the client side?

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 7.9
  • leapp

Issue

leapp fails with "Unable to install RHEL 8 userspace packages".

2022-09-19 13:33:16.333 DEBUG    PID: 18908 leapp.workflow.TargetTransactionFactsCollection.target_userspace_creator: No match for argument: dnf
2022-09-19 13:33:16.340 DEBUG    PID: 18908 leapp.workflow.TargetTransactionFactsCollection.target_userspace_creator: No match for argument: dnf-command(config-manager)
2022-09-19 13:33:16.347 DEBUG    PID: 18908 leapp.workflow.TargetTransactionFactsCollection.target_userspace_creator: Error: Unable to find a match: dnf dnf-command(config-manager)
2022-09-19 13:33:16.387 DEBUG    PID: 18908 leapp.workflow.TargetTransactionFactsCollection.target_userspace_creator: Command ['systemd-nspawn', '--register=no', '--quiet', '-D', '/var/lib/leapp/scratch/mounts/root_/system_overlay', ..., 'dnf', 'install', '-y', '--nogpgcheck', '--setopt=module_platform_id=platform:el8', '--setopt=keepcache=1', '--releasever', u'8.6', '--installroot', '/el8target', '--disablerepo', '*', '--enablerepo', u'rhel-8-for-x86_64-baseos-rpms', '--enablerepo', u'codeready-builder-for-rhel-8-x86_64-rpms', '--enablerepo', u'rhel-8-for-x86_64-appstream-rpms', 'dnf', 'dnf-command(config-manager)', '-v'] failed with exit code 1.

Resolution

Multiple reasons can explain your repositories are not reachable.

Follow at first the below KCS:
RHEL 7 to RHEL 8 LEAPP Upgrade Failing When Using Red Hat Satellite

And then check dnf version 4.0.9 (from RHEL 7 extras) is able to install dnf version 4.7 from your el8 repositories, as Leapp does.

Don't forget to adapt the URL (domain and path), the SSL certificate & key ("XXX"), and the $releasever (here 8.8) to your environment.

# cat << EOF > /etc/yum.repos.d/test.repo
[test]
name = test
baseurl = https://<URL>/pulp/repos/Default_Organization/Library/content/dist/rhel8/8.8/x86_64/baseos/os
enabled = 0
gpgcheck = 0
sslverify = 1
sslcacert = /etc/rhsm/ca/katello-server-ca.pem
sslclientkey = /etc/pki/entitlement/XXX-key.pem
sslclientcert = /etc/pki/entitlement/XXX.pem
EOF

# dnf clean all
# rm -rf /var/cache/dnf/*
# mkdir /var/lib/leapp/test
# dnf install -v -y --releasever 8.8 --installroot=/var/lib/leapp/test --disablerepo '*' --enablerepo test dnf

If it does not work, the issue likely comes from your Satellite server. On the client side, please check /var/log/dnf.log and /var/log/dnf.librepo.log for more details.

SBR
Components
Category

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.