How To Fix Broken Ubuntu OS Without Reinstalling It

30 Responses

  1. DFD says:

    Not so long ago one would say Windows, instead of Ubuntu. The answer would be very similar: in the past, install Linux instead. Here, instead a real Linux distribution instead.

  2. Mulya says:

    And what do you do if you can’t get the to login screen to access terminal (tty)?

  3. laddd44 says:

    does it work in offline mode pc??

  4. J says:

    Thanks a lot, your list helped me also via an SSH connection from a remote PC. I needed to do it that way because the linux machine did not respond on CTRL+ALT+F1 to open directly tty1.

  5. JEVBR says:

    Thanks SK, that really solved my problem here. Saved my a lot of reinstalling all my programs (did have a backup). I messed up the installation process when at some point i opted for “show the difference” when asked if i wanted to update. At this point the installation went sideways. At the end i was not allowed to re-install before restarting, but the restart was locked (I guess i was deadlocked). Had to use the power button to restart.

    Terminal is very useful, i use it a lot, but for most simple users, user-friendliness goes out the window as soon as terminal appears. Seems to me update process may need some reviewing

  6. José Rosales says:

    Thank you this should be a marked post

  7. Richy Doc says:

    Very good procedure. Save me a lot of time.
    Thank.
    Richard.

  8. randy says:

    How can this work? If you used a usb stick to run the “live cd” and didn’t mount your linux partitions on the disk, then performing sudo rm /var/lib/apt/lists/lock will apply to the live OS, not the broken one on your hard disk!

    I think the “broken” linux partition must be mounted and your commands would look something like this: sudo rm /media/myroot/var/lib etc.
    Anyway, I will try it, got nothing to lose at this point.

  9. Jaz says:

    The method that is described in this article is only referring to if you can still reach ubuntu log in. If you use a live cd or usb you would mount the relevant partitions then chroot into that mount point. Then those commands described can be used.

  10. Jose Tuttu George says:

    sudo dpkg –configure -a

    “Processing was halted because there were too many errors.” is the error I am getting. I regret my decision to upgrade OS. Any help on this? I don’t have live cd. My cd drive broke long time ago.

    • sk says:

      Can’t you switch to tty1 by pressing CTRL+ALT+F1? If yes, you don’t need a live cd. Just run the aforementioned commands one by one and see it solves your problem. If you can’t switch to tty1, may be you should try live usb.

  11. Kevmate says:

    This worked brilliantly for me – thanks. One comment, I am using grub and during the update it asked what I wanted to do about grub. I said keep the original. Afterwards grub worked but the menu had changed. Ubuntu now on there twice, and advanced options added. Not sure if I should have upgraded grub. Anyway, all good.

  12. Kevmate says:

    BTW – I found that I had to use ctrl-alt-f3 to swicth to tty1.

  13. tobiz says:

    This may be just what I’m looking for! My kubuntu 18.04 system failed to boot into kubuntu after having done a synaptic “auto remove” (I thought it was safe!) After that all I could do was boot into a screen that said something like “screen resolution problem” and offered entering tty mode. At that point I tried installing some “kde” things I thought might have got removed but no luck. I therefore resorted to boot from kubuntu 18.04 usb stick into “kubuntu try” and found my main 1Tb disc was still accessible; I did have backups but I made 2 copies of anything else I might need if a full re-install was needed, eg apt-get data. I thought it might be a basic boot problem so tried the boot-repair app, but it seemed to fail and not convinced it improved matters. I’ve just found your procedure and wonder, if, boot-repair hasn’t made things worse, it might work, I understand the point about the main disk being mount, which mine is so under “kubuntu try” could see if it works under chroot. If it does you’ll have saved my life; I’ll let you know.

  14. vaya says:

    hi, how about if I crash since do sudo apt purge python3. I got tty1, I already do above commands and reboot
    but I got same result

  15. GeneralFault says:

    This saved me a few hours of work. Thank you very much. My 18.04 LTS system got hosed after I tried to uninstall KDE and some of its applications. The crashing terminal is working again and the battery indicator is back.

  16. yjojo says:

    You are a hero! Had done an upgrade on AntiX and then could not boot. Followed your steps and I’m back up and running. Thank you!!

  17. Carlos says:

    Hi, DFD. Which distribution you recommend then?

  18. Bubba says:

    Is “sudo dpkg –configure -a” supposed to be listed twice?

  19. Iliyan says:

    I hope this should work on Linux Mint?

  20. Tim Palmer says:

    This article helped me immensely. Thank you very much!

  21. Tuxor99 says:

    Fantastic. Worked flawlessly on broken 18.04 directly up to 20.04. Thanks!

  22. Goutham Vijapur says:

    I was trying to upgrade my Ubuntu 18.04.4 LTS to 20.04 LTS

    I used the ‘update-manager -d’ command as provided in the tutorial (https://ubuntu.com/tutorials/tutorial-upgrading-ubuntu-desktop#1-before-you-start)

    At some point of time my screen went blank and was stuck at “[OK] Started Manage, Install and generate color profiles”

    After almost 30 mins, I restarted the system and it wouldn’t boot properly. the screen was stuck at “[OK] Started GNOME Display Manager (etc… etc…)”

    I followed the solution in this blog and finally I have my system upgraded to Ubuntu 20.04 LTS, up and running with all the files and previously installed softwares intact.

  23. Yahia Asrawi says:

    Thanks, it helped.

  24. chola says:

    Glad you even got to the login screen.
    I don’t know what error hit me, OS froze and after I restarted the laptop, Ubuntu won’t get past the EFI loading bit.
    It’s ruined my day

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.