Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I know it is funny situation but i removed python with all associated programs from Ubuntu using sudo apt-get remove python? Obviously i can install back python, but it will take me a lot of time to install all programs that i removed. Maybe there is some solution?

Thanks

share|improve this question
    
Please include research effort to remove down vote. –  Colyn1337 Nov 21 at 15:33

5 Answers 5

up vote 12 down vote accepted

There is not an easy way but if you look at /var/log/apt/history.log you can see what was removed. Just reinstall each package that was removed.

share|improve this answer
    
It just saved my life! –  Sanket May 24 '13 at 13:21

Look up all the packages that got uninstalled. It is stored at /var/log/apt/history.log . You can write a shell program to install each package that was removed. Write it on any text editor GNU Emacs, vi, GNU Nano. Execute it through the terminal. All the programs that got uninstalled will get re-installed by themselves.

share|improve this answer

To add to ablackhat's answer, you can copy and paste everything after the last remove command in /var/log/apt/history.log into a new programmers editor. Regex replace :.*?, with (empty string), and copy all the resulting space-separated packages. Then run $ sudo apt-get install <paste>

share|improve this answer

I just did this mistake, you can run the below commands to undo the remove of packages This will extract the information of the removed packaged from the log file and reinstall them

echo '#!/bin/bash' > restore
echo sudo apt-get install `grep Remove /var/log/apt/history.log | tail -1 | sed -e 's|Remove: ||g' -e 's|([^)]*)||g' -e 's|:[^ ]* ||g' -e 's|,||g'` >> restore
chmod +x restore 
./restore
share|improve this answer

if you

 apt-get install python

Python will be reinstalled with all of its prerequisites which is what I'm assuming was all the associated programs your speaking about?

share|improve this answer
    
I have already installed Python, but programs which where dependent on it like Zim, GImp and a lot of others wasn't reverted(( Even Gedit isn't working –  IgorDiy Apr 18 '12 at 20:11
    
-1. Doesn't resolve the OP's question in that everything that needs Python got removed also. –  Magellan Apr 19 '12 at 14:23

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.