Red Hat Enterprise Linux Diagnostics and Troubleshooting
Resolve a package dependency issue, and then lock the prerequisite package to the relevant version.
Outcomes
You should be able to resolve package dependency issues.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
[student@workstation ~]$ lab start rpm-dependency
Instructions
The security team recently updated the system requirements for hosts in the data center. The update requires installing a custom package, rht-main, on each host.
A colleague attempted unsuccessfully to install rht-main on servera. You are asked to resolve this issue and to verify that the rht-main package installs successfully.
After installing the rht-main package, ensure that you can update the prerequisite rht-prereq package.
Create a version lock for the rht-prereq-0.1-1.el8 package.
Log in to
serveraand switch to therootuser.[student@workstation ~]$
ssh student@servera...output omitted... [student@servera ~]$sudo -i[sudo] password for student:student[root@servera ~]#Reproduce the issue, to collect and record troubleshooting information.
Use YUM to install the
rht-mainpackage. View the transaction messages.[root@servera ~]#
yum install rht-mainLast metadata expiration check: 2:29:27 ago on Wed 13 Oct 2021 05:41:46 PM EDT. Error: Problem: package rht-main-0.1-1.el8.noarch requires rht-prereq = 0.1-1.el8, but none of the providers can be installed - conflicting requests - package rht-prereq-0.1-1.el8.noarch is filtered out by exclude filtering (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)The transaction message indicates that the
rht-mainpackage requires a specific version (0.1-1.el8) of therht-prereqpackage.Use the
yum install -vcommand to generate verbose transaction details.[root@servera ~]#
yum -v install rht-mainLoaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, groups-manager, kpatch, needs-restarting, playground, repoclosure, repodiff, repograph, repomanage, reposync, uploadprofile, versionlock YUM version: 4.4.2 ...output omitted... Last metadata expiration check: 3:11:29 ago on Mon 18 Oct 2021 07:59:41 PM EDT. Completion plugin: Generating completion cache...Versionlock plugin: number of lock rules from file "/etc/dnf/plugins/versionlock.list" applied: 1--> Starting dependency resolution --> Finished dependency resolution Error: Problem: package rht-main-0.1-1.el8.noarch requires rht-prereq = 0.1-1.el8, but none of the providers can be installed - conflicting requests - package rht-prereq-0.1-1.el8.noarch is filtered out by exclude filtering (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)The Versionlock plugin line indicates that a single package is present in the version lock list. Therefore, your next steps are to view dependencies and to verify whether a version lock is the root cause of the issue.
Use the
yum deplistcommand to view therht-mainpackage dependencies.[root@servera ~]#
yum deplist rht-mainLast metadata expiration check: 2:01:55 ago on Wed 13 Oct 2021 05:41:46 PM EDT. package: rht-main-0.1-1.el8.noarch dependency: rht-prereq = 0.1-1.el8 provider: rht-prereq-0.1-1.el8.noarchTo list all versions, both installed and available, of the
rht-prereqpackage that are known to the YUM configuration, use theyum list --showduplicatescommand.[root@servera ~]#
yum list --showduplicates rht-prereqLast metadata expiration check: 2:01:24 ago on Wed 13 Oct 2021 05:41:46 PM EDT. Installed Packages rht-prereq.noarch 0.2-1.el8 @rht_lab Available Packages rht-prereq.noarch 0.1-1.el8 rht_lab rht-prereq.noarch 0.2-1.el8 rht_labThe command output indicates that a later version of the
rht-prereqpackage,0.2-1.el8, is already installed. However, therht-mainpackage requires an earlier version of therht-prereqpackage. Because YUM automatically resolves package requirements even with version conflicts, additional troubleshooting is required.To determine whether any packages have specific version locks, use the
yum versionlockcommand.[root@servera ~]#
yum versionlockLast metadata expiration check: 2:02:30 ago on Wed 13 Oct 2021 05:41:46 PM EDT. rht-prereq-0:0.2-1.el8.*The
rht-prereqpackage is locked to a later version than the required version.To resolve the version lock conflict, delete the version lock for the
rht-prereq-0:0.2-1.el8package.[root@servera ~]#
yum versionlock delete rht-prereq-0:0.2-1.el8Last metadata expiration check: 2:59:52 ago on Wed 13 Oct 2021 05:41:46 PM EDT. Deleting versionlock for: rht-prereq-0:0.2-1.el8.*Confirm the deletion.
[root@servera ~]#
yum versionlockLast metadata expiration check: 3:00:06 ago on Wed 13 Oct 2021 05:41:46 PM EDT. [root@servera ~]#
Use the
yumcommand to install the mandatedrht-mainpackage.[root@servera ~]#
yum install rht-mainLast metadata expiration check: 3:05:12 ago on Wed 13 Oct 2021 05:41:46 PM EDT. Dependencies resolved. =============================================================================== Package Architecture Version Repository Size =============================================================================== Installing: rht-main noarch 0.1-1.el8 rht_lab 6.8 k Downgrading: rht-prereq noarch 0.1-1.el8 rht_lab 6.7 k Transaction Summary =============================================================================== Install 1 Package Downgrade 1 Package Total size: 13 k Is this ok [y/N]:yDownloading Packages: Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Downgrading : rht-prereq-0.1-1.el8.noarch 1/3 Installing : rht-main-0.1-1.el8.noarch 2/3 Cleanup : rht-prereq-0.2-1.el8.noarch 3/3 Verifying : rht-prereq-0.1-1.el8.noarch 1/3 Verifying : rht-prereq-0.2-1.el8.noarch 2/3 Verifying : rht-main-0.1-1.el8.noarch 3/3 Downgraded: rht-prereq-0.1-1.el8.noarch Installed: rht-main-0.1-1.el8.noarch Complete!As displayed in the transaction summary, the
yumcommand downgrades therht-prereqpackage from version0.2-1to0.1-1; installs therht-mainpackage; and then removes therht-prereq-0.2-1.el8.noarchpackage.Now that the
rht-mainpackage is installed, attempt to update the prerequisiterht-prereqpackage. Because of dependencies, YUM generates an error message and fails.[root@servera ~]#
yum update rht-prereqLast metadata expiration check: 3:58:51 ago on Wed 13 Oct 2021 05:41:46 PM EDT. Error: Problem: problem with installed package rht-main-0.1-1.el8.noarch - package rht-main-0.1-1.el8.noarch requires rht-prereq = 0.1-1.el8, but none of the providers can be installed - cannot install both rht-prereq-0.2-1.el8.noarch and rht-prereq-0.1-1.el8.noarch - cannot install the best update candidate for package rht-prereq-0.1-1.el8.noarch (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)Create a version lock for the installed
rht-prereqpackage. Adding a version lock ensures that YUM ignores any attempt to update therht-prereq-0.1-1.el8package.To lock the installed version of the
rht-prereqpackage, use theyum versionlock addcommand.[root@servera ~]#
yum versionlock add rht-prereqLast metadata expiration check: 0:32:06 ago on Wed 13 Oct 2021 09:52:41 PM EDT. Adding versionlock on: rht-prereq-0:0.1-1.el8.*Verify that the
versionlocklist includes therht-prereq-0:0.1-1.el8package.[root@servera ~]#
yum versionlockLast metadata expiration check: 0:34:09 ago on Wed 13 Oct 2021 09:52:41 PM EDT. rht-prereq-0:0.1-1.el8.*
To verify that YUM no longer prints an error message when attempting to update the
rht-prereqpackage, run theyum updatecommand again.[root@servera ~]#
yum update rht-prereqLast metadata expiration check: 0:36:01 ago on Wed 13 Oct 2021 09:52:41 PM EDT. Dependencies resolved. Nothing to do. Complete!Return to
workstationas thestudentuser.[root@servera ~]#
exit[student@servera ~]$exit[student@workstation ~]$