How to remove a package without removing dependencies in RHEL

When you remove a package with the command

yum remove PKG_NAME

yum will remove all other packages that are dependent on the package you are removing.

To remove a package without removing its dependency on Red Hat Linux or RHEL based distributions like CentOS, AlmaLinux, Rocky Linux or Oracle Linux, you can run the command

Advertisement

rpm -e --nodeps PKG_NAME

If you want to keep files, just remove the entry, use

rpm -e --nodeps --justdb PKG_NAME
Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement