Ubuntu – How to get Ubuntu back into pristine conditions

debianinstallationUbuntu

I want to restore a Ubuntu installation back into the state it had when it was freshly installed without actually doing an actually reinstall, i.e. I want to remove all packages that where installed afterwards and are not part of the default installation.

How would one accomplish this or where could I find a list of packages that are installed on a default Ubuntu installation (for diff'ing against dpkg -l)?

Best Answer

Well, the base package list (assuming this is a desktop system) is built by the combination of the ubuntu-minimal and ubuntu-desktop packages. These are metapackages that exist solely to depend on other packages. The problem, of course, is that their dependency list is not the complete package list. The packages they depend on may have other dependencies.

So... I would suggest playing around in aptitude. Perhaps try flagging all installed packages for removal, then specifically selecting your active kernel, ubuntu-minimal, and ubuntu-desktop to be installed. With a little finagling, you should be able to reach a point where the only packages flagged to be removed are the ones not required by the two metapackages.

I haven't tried this. I haven't even experimented with it. You may hose your system by following my suggestions.

Have fun!

Related Topic