I heard that I should never use
--nodeps option when I do a
rpm -e command.
Why does this option exist then?
It exists for broadly the same reasons
rm will allow you to delete the filesystem root, or
dd will allow you to overwrite the physical hard drive:
Linux and unix have a long history of giving you all the ammo you need when you really insist on shooting yourself in the foot.
Less flippantly, when something has gone badly wrong during a package install, whether due to a badly built package or an outage at the worst possible moment, it's possible to wind up with your package manager's dependency database in gridlock -- IE, it can't resolve the problem because attempting any of the solutions would violate the dependencies of the other packages involved. In that case, you can use
--nodeps, or for dpkg, the
--force-* options to manually and forcibly remove the offending package, and then immediately issue what commands are necessary to fix the now broken dependencies.
That's something you should only do if you're really sure of what you're doing, however; as a rule of thumb, if you aren't sure what use
--nodep is, don't use it. You're essentially taking all the safeties off, and gods help you if you screw something up while doing it.
--nodeps is when we do not want to verify package dependencies.
If you will use it with rpm it will not verify the package dependencies, and the installed package might not work as it should.
If you will use it with rpm -e command, the package will be erased without giving you warning, if some other packages are dependent on the package you are trying to erase.