–force V/s –nodeps : rpm command options to install or uninstall a package

These rpm options can potentially corrupt a Linux server so severely a reinstall may become necessary. So be cautious while playing with them.

–force V/s –nodeps

–force

Ignore package and file conflicts for install — package might stop working properly leading to serious issues

–nodeps

Do not check dependencies — package might not work properly after using this flag ( or dependent packages might stop working )

Often one RPM package requires one or more other RPM packages to work correctly. Sometimes an RPM may depend on a particular version of another RPM. The complex interactions are maintained by the yum and rpm tools. Using either of the –force or –nodeps can damage the package relationships and lead to unrelated failures that are extremely difficult to diagnose and repair.

By using option –force for installation will not guarantee that installed package will work correctly, the package files are installed without regard whether they will work with the rest of the system.

Similarly, usage of –nodeps for install and uninstall might cause serious trouble to packages which still depend on that package. During installation rpm(8) will not install necessary packages for actual rpm to work properly causing serious dependency problems.

Best Practice

Never forcibly install an RPM package. Only use the –force or –nodeps option if your support team suggest you to do so. There are scenarios where these options can be useful but they have a strict use case.

Recovery

To verify the RPM library correctness after such having used –force or –nodeps check the RPM database like this:

# rpm -Va
#

If the RPM database is correct, there will be no output. Certain files are flagged as configuration files which are expected to be customized; these are marked by the letter “c” in the second field else the second field will be blank. Any other line will represent a failure detected by RPM. The filename will be the third field. To map the filename back to the RPM package do this:

# rpm -qf /bin/bash
bash

If rpm was part of the core O/S packages, for example, glibc, reinstalling Linux may be the best solution because almost every application relies upon the general C library. Please note that yum as a comparable option which can cause similar damage.

Related Post