How to stop yum/dnf from removing an unused dependency

Solution Verified - Updated -

Issue

  • When removing a package, yum also removes any dependencies not required by anything else
  • How to keep an "unused dependency"
# yum remove initial-setup-gui
Dependencies resolved.
================================================================================
 Package                               Arch   Version          Repository  Size
================================================================================
Removing:
 initial-setup-gui                     x86_64 0.3.62.1-1.el8   @AppStream  26 k
Removing unused dependencies:
<59 packages listed>
Transaction Summary
================================================================================
Remove  60 Packages

Environment

  • Red Hat Enterprise Linux 8

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content