How to remove an uninstalled package's dependencies?

I want to install a package (DigiKam), but it has a lot of dependencies. If I decide I no longer need this software and uninstall it, will the now unnessary dependencies be removed?

If not, how can I do it manually?

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

You can use the command apt-get autoremove. It will remove packages that are installed as automatic dependencies, but are not depended anymore.

apt-get has a flag --auto-remove that can be used to automatically remove the automatically installed packages when removing a manually installed package:

apt-get remove --auto-remove packagename

Certain other tools are also capable of doing this, for example aptitude will automatically suggest that you remove the packages that have been orphaned.

The automatically installed packages tracking is built in to apt so the tracking should work no matter which tool you use to install the packages.

Solution 2

aptitude purge digikam
deborphan
aptitude purge $(deborphan)

deborphan lists packages which are not used or do not depend. So you can safely uninstall them. I tend to use purge as option of aptitude because it removes also config files and other stuff.

Solution 3

The Computer Janitor, in the system menu can do this too.

Solution 4

I use ubuntu tweak, it has a very effecient app cleaning utility that has never removed more then it should.

Solution 5

sudo apt-get remove --auto-remove 

Only run this.

Install BleachBit from Software Center. When you clean ur system using it, BleachBit will automatically run this command to clean the apt cache.

Solution 6

I had the same problem. Here is what I did:

sudo apt-get check

This command will provide the name of dependencies. E.g. my system had chromium-browser-l10n.

Then enter the following command

sudo apt-get remove --auto-remove chromium-browser-l10n

It will remove the dependencies completely from your system

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply