Undo Synaptic Package Manager Removal

Asked by adwong

The Synaptic Package Manager removed about 100 software packages, some which were very important to me and time consuming to set up. Is there a way to role back or undo the removals?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu synaptic Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Kaulbach (mystic-scientist) said :
#1

The activities of the dpkg program is logged in the file /var/log/dpkg.log
A typical entry will look like so:
2008-10-08 01:35:25 status unpacked ndiswrapper-utils-1.9 1.50-1ubuntu1

So, if you know the day this happened you can do something like:
grep 2008-10-08 /var/log/dpkg.log|grep remove /var/log/dpkg.log|cut -d' ' -f4|sed '/packages/d' | sed 's/$/\t\t\t\tinstall/g' >> selections

This will grab all the names of the removed packages from that day and put them into a file called "selections" formatted in a way which can be used to reinstall them.

To use the file for this:
sudo dpkg --set-selections < selections && sudo apt-get dselect-upgrade

If you did not use a purge option when removing them originally, then the config files should still exist in places like /etc

Can you help with this problem?

Provide an answer of your own, or ask adwong for more information if necessary.

To post a message you must log in.