How To Fix Broken Ubuntu OS Without Reinstalling It

16 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.

  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.

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.