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

I accidently removed a package with the purge flag and it removed large parts of the Ubuntu system, including the pulseaudio server, the software center, system settings and many, many other programs and libraries.

I don't exactly know what the purge command does, but I'm pretty sure that it's used to remove a package along with it dependencies. So I guess it removed every package that shares dependencies with the package I wanted to remove, but it still does not make any sense.

I have the complete dpkg.log of removed packages, but reinstalling them via terminal is nearly impossible.

What should I do to recover the removed packages?

share|improve this question
up vote 3 down vote accepted

You could attempt to reinstall the entire desktop.

sudo apt-get install --reinstall ubuntu-desktop

It might be easier to just go through the list of removed packages one by one and reinstall.

What ever you do this would be a good time to make a backup in case you don't already have one so when things like this happen you can just revert your changes.

share|improve this answer
Thanks. It worked. – user87759 Sep 5 '12 at 19:27

Why is it impossible? If you have a log of removed packages, just run

sudo apt-get install package1 package2 package3 ...

This should really do the trick. If you run into problems, post your dpkg.log and any errors / problems you have encountered here.

P.S. The --purge option just makes sure that all config files are removed as well.

share|improve this answer
The log would be in /var/log/apt/history.log. – roadmr Sep 5 '12 at 19:15
So why that command removed so many packages from my system? I just wanted to remove MySQL to make a clean reinstall of it - that's why I used the purge option. I guess I should know better every command before using it. – user87759 Sep 5 '12 at 19:25

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.