4

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?

2 Answers 2

3

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.

0
0

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.

2
  • The log would be in /var/log/apt/history.log.
    – roadmr
    Sep 5, 2012 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, 2012 at 19:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .