Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to make my system go back to how it was when first installed ubuntu without doing the standard installation again? I want my packages, repositories, configuration files to go back to how it was when ubuntu 12.04 LTS was first installed.

Is that possible?

share|improve this question


Sadly dpkg or apt dosn't keep a log of what packages were installed / removed and when, as far as I know. The best shot here is to look through your .bash_history and try to find what you modifyed. (You do know that dpkg -l will show you all packages that are installed configured etc. right?)

To properly purge a package use:

apt-get remove --purge <package>

To reconfigure ALL packages on your system use the following command (as root):

dpkg -l | cut -d " " -f3 | xargs dpkg-reconfigure

Be aware that this will possibly take some time.

These tools are capable of getting a lot of configuration "reseted" but they are incapable of magic. If you messed up your system really bad then the best solution sometimes is to back-up everything and reinstall.

You can use dpkg-reconfigure <package-name> to "reset" most packages to their defaults; but no-one knows what you installed with your systems main install except you.

You could search for which packages a "default" installation puts on your machine and remove everything else, but then again we can't know what you installed with your system's base install.

share|improve this answer
But my system knows what packages are installed into it. Can I at least run some commands to reconfigure all of them? My problem is that some configuration files that I deleted manually don't get created again. I tried all apt-get commands, purge, autoclean install(again) but they just refuse to be recreated. Is there a solution to that? (pretty annoying) P.S dpkg-reconfigure postgresql, postgresql is the annoying package, didn't do it. – Deus Deceit Jan 23 '13 at 19:57
Did you try to purge / reinstall postgre? (You'll want to back up the databses you have before that.) – Wolfer Jan 23 '13 at 20:13
Also you might search for your missing config and re-create it manually (restarting postgres after it). It's pretty voodoo, but it might work. – Wolfer Jan 23 '13 at 20:19
I did try purge/re-install. As I said I tried all I know with apt-get. I will now try the second option you listed in your edit. – Deus Deceit Jan 23 '13 at 20:25
Apt does log the history in /var/log/apt/history*:… – Takkat Jan 23 '13 at 21:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.