How to Remove Unused Application Dependencies in Ubuntu?

Just like in any other platform, depending on the application, whenever you install a software in GNU/Linux a series of other small libraries/apps are also automatically installed. These are called “dependencies”. When I was extremely new to GNU/Linux I had quite a hassle while trying to install apps because at that time I didn’t have a fast Internet connection and had to manually “resolve” these dependencies (not the most joyful thing in the world to be honest :D)

Anyway, did you know that when you remove a program in Ubuntu (as I’m writing this for those who are new to Ubuntu), most of the time due to various reasons not all the dependencies that were first installed with that program are removed?

Now you should not manually remove them. Firstly because it’s hassle and not gonna speedup your PC like super man :). Secondly, some of those dependencies might be used by other software. So if you remove them, then some of your existing applications might not work (although when trying to do so you’ll get errors saying that some dependencies cannot be removed since they’re being used by other apps).

But did you know that in Ubuntu (including Debian or any GNU/Linux distro as long as it uses the APT package manager) by using a single command we can automatically remove all these unused dependencies that take both your HDD space and sometimes slow down your PC ?

To safely and easily remove all those unused dependencies in Ubuntu open your Terminal window and type the below command.

sudo apt-get autoremove

When asked confirm the “autoremove” process and the rest will be taken care of.

As an additional step, you can also remove the temporarily stored package downloading cache folder too. If you don’t know what the heck that it, then it’s a temporary location where packages are downloaded prior to their installation (don’t worry, nothing will happen to your installed applications).

For that use the below command.

sudo apt-get autoclean

Now if you don’t usually install a lot of software then this is not like a big deal but like me if you’re used to installing all sorts apps then this might come in handy for saving both your HDD space.

If want, you can get additional information about this by reading the “apt-get” manual. For that use the below command in your Terminal window.

man apt-get

Are there any disadvantageous?

*. Yes, there’s one that I’m aware of. Because as long as you don’t remove these unused dependencies, whenever you try to install a new program some of its dependencies might already be installed thus it won’t have to re-download and install it.

This saves both time and bandwidth of your Internet connection because otherwise the application has to re-download and install them manually.  But personally I like to remove them because it does help to speed things up a bit (and HDD space too).

That’s the only disadvantage that I can think of, so I’ll leave the decision up to you :).

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: