Howto Clean up your packages

Sponsored Link
It's worthwhile to do this every now again again on your ubuntu box when you've been installing and uninstalling new apps. This will go through and check which packages have been installed that are no longer needed. It will then remove them for you

apt-get autoremove

Output looks like below

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libcommoncpp2-1.5.3-0
The following packages will be REMOVED
libcommoncpp2-1.5.3-0
0 upgraded, 0 newly installed, 1 to remove and 29 not upgraded.
Need to get 0B of archives.
After unpacking 688kB disk space will be freed.
Do you want to continue [Y/n]?

Here you need to select Y to remove these packages

You may also like...

5 Responses

  1. Kevin says:

    Or just use aptitude when you add and remove programs instead of apt-get… it will mark packages that were installed as dependencies and when you remove a package it will also clean up the dependencies.

  2. Scott says:

    I don’t like using aptitude because it defaults to automatically installing all -suggested- packages along with the dependencies, which is very rarely to never what I want to do. I don’t want any extra stuff installed, only what’s necessary.

    Package dependencies are required by other packages in most cases anyway (isn’t that the whole point of using common libraries?), and even after years of apt-get installing and removing, very little cruft seems to build up. Not enough to worry about having to clean it up, maybe a handful of packages.

  3. Fergus says:

    Are there any other ways of cleaning up more space? I’ve done apt-get autoremove and I’m still using 94% of diskspace

  4. Kouakou says:

    be careful with the autoremove, it may remove stuff that you do need….I found it out the hard way

  5. UnklFungus says:

    Yeah, I have used autoremove before without any problems. I used it last night and Ubuntu is basically gone. But, hey, who needs 50gb of precious family pictures anyway…

Leave a Reply

Your email address will not be published. Required fields are marked *