Ubuntu: Ubuntu recovery mode



Question:

I have dual boot with Ubuntu 14.04 and windows 8 on my computer. So recently I accidentally removed some important packages from my ubuntu and now when I try to load Ubuntu from the GRUB list, it boots up only as a terminal.

I tried to boot Ubuntu in recovery mode, but the recovery menu does not show up also. Even the recovery mode boots into a terminal shell.

Please someone help. I appreciate


Solution:1

I had a similar problem getting into recovery mode, have you tried using the escape key rather than the shift key during boot-up? The whole internet says that it is the shift key, but it only worked for me when I pressed the escape key. Then from there, a dpkg tool is there for broken packages and you can open a shell as root if you have lost any privileges. Besides this I'm not sure what else to say but good luck.


Solution:2

Look what was removed:

grep 'remove ' /var/log/dpkg.log | less  

(if the logs are already rotated, then look inside dpkg.log.1, dpkg.log.2.gz, dpkg.log.3.gz, etc.)

Dump it into file:

grep 'remove ' /var/log/dpkg.log > ~/removed-dpkg.log  

Then manually delete the lines from that file that are not related to the time when you removed the packages. Or you can instead select relevant lines with grep and specific date:

grep '2015-04-23 21:27' ~/removed-dpkg.log > to-restore-dpkg.log  

Then do the test run of installing:

awk 'BEGIN{ORS=" "}{if($3=="remove")print $4}' ~/to-restore-dpkg.log | xargs sudo apt-get --dry-run install  

Delete the --dry-run option to actually do the install.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »