As your Debian/Ubuntu system gets older, there might be a number of packages lying around on your hard disk, that you no longer need. These packages are called orphaned packages. Usually they contain libraries, that were required by another software package you installed. Maybe the software package was replaced by a new package, that dropped the dependency on that library (version). Or you removed the software package entirely, because you no longer needed it.
These orphaned packages are not used by any other packages and are therefore taking up useless space. You can remove them with deborphan.
If deborphan is not already installed on your system, install it.
sudo apt-get install deborphan
Now you can use the following combination of commands to automatically remove all software packages, that are found by deborphan.
sudo deborphan | xargs sudo apt-get remove --purge
The latter should be done regularly to keep the number of redundant packages at a minimum.
Shameless plug: If this post was useful to you, please consider buying yourself something from one of my Amazon stores: US store, UK store, FR store, DE store, CA store. If you're not into Amazon, why not donate something to GNOME, Mozilla or Wikipedia? Thank you!



I think
sudo apt-get autoremovedoes the same and can be done with onboard tools in edgy. I did that some days ago and it freed 180MB of my hard disk.
No.
sudo apt-get autoremoveis different.deborphansearches for packages that have no dependency at all. In Edgyaptkeeps track of packages, that were installed as dependencies. If you use the optionautoremove,aptwill use this information collected earlier to remove all packages, that were installed as dependencies and that are no longer needed. Optionally it takes a parameter and removes only the packages, that were installed as dependencies of a particular program.See https://wiki.ubuntu.com/AptAutoRemove for a discussion of this feature.
In fact,
autoremoveis much more powerful thendeborphan. While the packagesdeborphandeclares as unused are mostly libraries (it can’t know, if a tool was installed as a dependency, because it has no database),autoremoveis likely to remove packages of programs, that were installed as dependencies of other program packages, too.To be fair, I wasn’t aware of
autoremovesince it was introduced in Edgy and does not seem to be available upstream (in Debian). Depending on your situation,autoremovemight be better thandeborphanor not.