Search This Blog

Tuesday, 22 October 2013

Recover from Ubuntu UPDATE Failure

Fixing a fucked Ubuntu system after a failed upgrade

BACKGROUND
I was upgrading to a new release of Ubuntu and switched the computer off half way through.  I thought I'd fixed it, but the next time I turned it on the installation never completed the boot process, failing to connect to screen or input devices properly.  I guess the symptoms may vary, but the solution may be pretty standard.

SOLUTION

  1. Make a bootable USB iso, and boot from it.
  2. Attach wired network connection
  3. Press CTRL-ALT-F1
  4. sudo fdisk -l /dev/sda and find your Linux partition - let's say it's /dev/sda5
  5. mount /dev/sda5 /mnt
  6.  
  7. # mount the special filesystems:
  8. mount -o bind /proc /mnt/proc
  9. mount -o bind /dev /mnt/dev
  10. mount -o bind /sys /mnt/sys
  11. mount -o bind /dev/pts /mnt/dev/pts
  12. cp /mnt/etc/resolv.conf /mnt/etc/resolv.conf-original
  13. cp /etc/resolv.conf /mnt/etc/resolv.conf
  14. apt-get update
  15. apt-get dist-upgrade


Points to note.

  1. If ifconfig complains about missing /dev/net ... you haven't done (10) 
  2. If copying the resolv.conf didn't work (name resolution is failing), exit from chroot, make sure the network is working with that wired connection, and copy the resolv.conf across again

No comments:

Post a Comment