Cleaning up your Ubuntu Installation

(from http://www.yatblog.com/2007/04/22/cleaning-up-your-ubuntu-installation/)


After upgrading my Ubuntu 6.10 installation to the newest 7.04 (Feisty Fawn) over a thousand packages were upgraded. So it’s obvious that there were left some dependencies which are not needed anymore. Sure everything still works, but I like to clean up things on Operating Systems I use productively. That’s why I wrote a script to clean up those dependencies with a single command. Here’s what you should do if you want to clean up your Ubuntu Installation (no matter which version) as well:

  1. Download and install the deborphan package. This is the application that finds unnecessary dependencies: “sudo apt-get install deborphan”
  2. Execute this command until there are no more dependencies: “apt-get remove $(deborphan)”

Alternatively, you can also put that command into a script, if you don’t want to remember that line:

  1. Download the script here: del_orph_pkgs.txt
  2. Change the filename from “del_orph_pkgs.txt” to “del_orph_pkgs.sh” and do a “chmod +x del_orph_pkgs.sh” so we can execute it.
  3. Execute the script with “sudo del_orph_pkgs.sh” multiple times until it won’t find anymore dependencies. This is necessary, because those libraries, which are not needed anymore, might have dependencies them self, which become obsolete. So another execution cycle will eliminate those as well.

你可能感兴趣的:(ubuntu,UP)