Which path should you follow? Should you take advantage of Ubuntu's package manager and use it to upgrade your system to the latest 8.04 Hardy Heron release, or should you download a CD or DVD ISO image and do a clean install? Common wisdom says that doing a clean install is the better, safer course of action. There may be a little extra work involved configuring everything once the latest and greatest is installed, but that's nothing compared to the pain of an update gone wrong, according to traditional thinking. But that cautious approach may no longer be necessary.
If you want to clean up your Ubuntu or Debian machine and delete unnecessary (orphaned) deb packages you can use utility deborphan. It finds packages that have no packages depending on them. The default operation is to search only within the libs and oldlibs sections to hunt down unused libraries.
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.