Thursday, 1 November 2007

Recovery when you remove some packages by mistake

Sometime when you install some new package, it will remove all its conflict packages, before this, you will be notified. But most of the people like me don't want to read all of the long-winded words every time. So sooner or later you will make such mistake.

Yes, I did. when I install some package about pulseaudio, which comes with Fedora 8 next week, one of the plugins conflicts with the current system sound server, so it removed the esound server and all relative packages (including all the Gnome and Kde package). I can not log in the X windows environment.

########################################

Here are the solution:
1.
a. find the synaptic history log files, which are stored in /root/.synaptic/log/, sorted by date. You can not use 'cd' to browse the folder, so you must use 'ls' and 'cp' to get the file.
b. remove some contents of the file, just leave the removed packages.
c-1. using vi, input such command when you click':', '1,$j'. Here j can make all the lines in the file into 1 line.
c-2. (another method) tr -c "[a-z][A-Z]" " " < thefile
d. At the beginning of the file, add 'sudo apt-get install -y'. Here 'y' force every installation continue without prompt.
e. sh+the file. everything start. when it finished. your system recovered.

2.
at step 1.c. using 'sed' to add 'sudo apt-get install -y' before each line. it works, but two slow and a lot of repeat work by computer.

No comments:

My photo
London, United Kingdom
twitter.com/zhengxin

Facebook & Twitter