When you install a program like postgresql, it installs several programs for its last version.
Once installed how remove all those packages? because using
apt-get remove postgresql
removes only that meta-package
Using Bash as your shell, ths would basically do the following:
You could alternatively replace the 3rd step and instead redirect the output into a file:
and then inspect the file, optionally do some adjustments (such as commenting out/removing lines where you want to keep a package), and finally execute the script using
Now you have a lot of possibilites to chose from :)
EDIT: Checking with more complex metapackages as e.g. lubuntu-desktop, above statements needs to be refined:
IMPORTANT: You should use this only for metapackages!!! otherwise, you may end up with an empty disk (e.g. postgresql-9.1 depends on libc6, and removing libc6 will certainly backfire as it is needed by a lot of packages). So be careful, and better redirect to a file first (as explained) and investigate before execution.
HIt Alt+Ctrl+T and run:
This command removes packages that are no longer needed, which is due to removing a package (such as postgresql) that depends on them.
You can always purge the configuration files with:
To clean even further, use the following:
Simple follow the following commands :