how to remove everything exept package "Foo"?

Asked by Koen

hi

if i upgrade to a new ubuntu, i often have a lot of package's i don't need anymore.

i was wondering if there was a command to go for the "clean" install again.
purging al package's exept for ubuntu-desktop and ubuntu-minimal and its dependencies. i don't know how to do it.

is there a command for it? or a script?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
Last query:
Last reply:
Revision history for this message
Best actionparsnip (andrew-woodhead666) said :
#1

If you want a clean install, then download the desktop ISO for the next release, MD5 test it and burn it slowly. You can then delete the / partition and reinstall. This is one reason why a seperate /home partition is HUGELY advantageous. You can do what you propose with:

aptitude --display-format '%p' search '?installed!?automatic' > ~/my-packages; gedit ~/my-packages

This is a list of ALL packages currently installed. You can then delete the package names you want to KEEP then run:

sudo apt-get --purge remove `cat ~/my-packages`

will remove the packages named in the file. You will then be left with the packages you removed from the file. Before proceeding with the removal

But a clean install will definately give a smoother ride, but it does take more effort

Revision history for this message
Koen (gorgabal) said :
#2

Thanks actionparsnip, that solved my question.