Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

2 Answers 2

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

 
discard

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.