Is It Safe to Use rpm --nodeps When Removing a Package?

Hello,
On my CentOS 7 and CentOS 8 systems, I want to remove the Samba packages without affecting other dependent packages.
Is it safe to use the --nodeps parameter for this? Has anyone had experience with this?

rpm -e --nodeps samba-client

ChatGPT 4.1 Replies:

Short answer:

Do not use --nodeps unless you are certain none of your system's critical services depend on the Samba client. Removing RPMs with --nodeps skips all dependency checks and can break packages that depend on Samba. This is generally unsafe and not recommended in production or multi-user systems.


Explanation

  • Without --nodeps:
    rpm -e samba-client
    This will refuse to uninstall if there are any installed packages depending on samba-client. It’s the safe, default behavior.

  • With --nodeps:
    rpm -e --nodeps samba-client
    This forces removal without checking or removing dependencies. Any packages depending on samba-client (directly or indirectly) will be left in a broken state, potentially causing system or application failures.


CentOS Best Practice

On CentOS 7/8, the recommended way to remove packages and their dependencies is with yum or dnf:

yum remove samba samba-client

or

dnf remove samba samba-client

These tools track dependencies and will prompt you with a list of packages to be removed, allowing you to cancel if you see anything critical.


When (if ever) to use --nodeps

  • Use only if you are building minimal, isolated, or test systems where you know exactly what depends on Samba and you accept the risk of breaking those dependencies.
  • Not recommended on general-purpose or production servers.

Summary:

Using --nodeps to remove Samba is not safe unless you are absolutely sure nothing else depends on it and you accept the risk of breaking system packages. Use yum remove or dnf remove for safe dependency handling.