Ubuntu – Any way to get a fresh ubuntu desktop without re-installing


I don't want to wipe my hard drive. I just want to get rid of all the extra software I've installed over time, and return to a prisitine, default system.

Best Answer

I do this occasionally, using aptitude. Aptitude is a console ("old-skool") tool that's powerful but a little tricky to get to use. It's like vim or emacs, when Ubuntu Software Center is like Gedit or AbiWord :-) Nevertheless, there's a good way to achieve your goal in aptitude, so if you're willing to give it a try, this might work for you.

First install aptitude:

sudo apt-get install aptitude

You might want to read the docs for aptitude. If you don't, you'll be following my directions below blind, and could fly into a mountainside that leaves your system unbootable, in which case you'll need to try one of the "careful reinstall" options where you do a fresh install trying to preserve your personal data along the way. The docs for aptitude are at:

zless /usr/share/doc/aptitude/README

Now, go into aptitude. I'll tell you a series of keys to press. The case (upper or lower) is significant: U is different to u.

sudo aptitude

u (this updates the package database. press enter to clear any warnings that popup afterwards)

arrow down to the section called "Installed packages"

M (this marks every package as automatically installed, so it schedules all of them for removal. don't quit now or you'll be in trouble)

/ (this opens a search dialog)

ubuntu-desktop [ENTER]

+(this tells aptitude you want to install ubuntu-desktop and all dependencies)

[ENTER] (goes into the details for the ubuntu-desktop package)

arrow down to the "Recommends" line

+ (tells aptitude to install all the recommended packages too)

g ("go" - will tell you what it wants to do)

g (confirms that you want to do it, and gets going)

That should leave you fully up to date, with a relatively clean, minimal desktop system.

If you get stuck, hit ? for help in aptitude. You may need to use a or z to scroll up and down in various places. I did say it was old-skool :-) But once you know how to use it, you can get a lot of detailed package management done quickly.