You are on page 1of 36

How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

 

Fix Windows Update in 2 Minutes. Re

techloris.com

Home  Ubuntu  How To Fix Broken Ubuntu OS Without Reinstalling It

UBUNTU FAQ LINUX LINUX ADMINISTRATION LINUX COMMANDS LINUX TROUBLESHOOTING TIPS AND TRICKS
TROUBLE SHOOTING UNIX/LINUX BEGINNERS

Written by Sk April 25, 2020 April 26, 2023 271K views

 63 comments        

JustThis
in case if your
website Ubuntu
uses cookiessystem is crashed
to improve due to power
your experience. failure
By using thisorsite,
network
we willconnectivity
assume that issue
you'reinOK
the middle o

the Upgrade process, you might endwith
up with
it. broken
AcceptUbuntu
ReadLinux.
More In such cases, you can easily

1 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

from scratch, and also without losing data as described below.

Today, I was system. Unfortunately, the power has gone in the middle of the
upgrade process and the system is powered o� abruptly while the packages are still being upgraded.

Fix Windows Update in 2 Minutes. Really Simple Instructions. Download Now.

techloris.com OPEN

When the power is back, I did boot the system again. Right after entering the login password in my Ubuntu
system, it's gone blank and didn't respond. Keyboard and mouse also didn't work.

All I see is just a blank screen! Thankfully, It's just a test machine and there were no important data in it. I can
simply wipe o� the entire OS and again.

But,
 I don't want to do that.
Since I got nothing to lose, I just wanted to system,
without losing data and also without reinstalling it completely. To my luck, it worked!!!
 
Now let us see how to Linux system, without reinstalling it.
 


First of all, try to login with live cd and in an external drive. Just in case, if this tutorial
didn't work, you can still have your data and reinstall everything!

At the login screen, press CTRL+ALT+F1 to switch to tty1 . You can learn more about switching between
TTYs .

This website uses cookies to improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

2 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

A Big
Mystery

Has Been Open

Solved
historykas

Now, type the following commands one by one to �x the broken Ubuntu Linux:

$ sudo rm /var/lib/apt/lists/lock

$ sudo rm /var/lib/dpkg/lock

$ sudo rm /var/lib/dpkg/lock-frontend

 
$ sudo dpkg --configure -a
 

 
$ sudo apt clean

$ sudo apt update --fix-missing

$This website
sudo apt uses cookies to-f
install improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

3 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

$ sudo dpkg --configure -a

$ sudo apt upgrade

$ sudo apt dist-upgrade

Finally, reboot the system using command:

$ sudo reboot

You can now be able to login to your Ubuntu system as usual.

After I followed these steps, I managed to successfully without reinstalling it. And
also, all the data in my Ubuntu system were intact and everything was in the same way as I left it.

A Big
 
Mystery
 
Has Been Open
 
Solved

historykas

This method may not work for everyone. However, this small tip worked for me and saved a couple minutes
from reinstalling my Ubuntu system from scratch.

If you know any other better way, please let me know in the comment section. I will add them in this guide as
This website uses cookies to improve your experience. By using this site, we will assume that you're OK
well. 
with it. Accept Read More

4 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...



APT APT COMMANDS DPKG FIX BROKEN UBUNTU OS LINUX LINUX ADMINISTRATION LINUX COMMANDS

LINUX HOWTO LINUX TROUBLESHOOTING UBUNTU UBUNTU ADMINISTRATION UBUNTU TROUBLESHOOTING

 63 comments        

Senthilkumar Palani (aka SK) is the Founder and Editor in chief of OSTechNix. He is a Linux/Unix
enthusiast and FOSS supporter. He lives in Tamilnadu, India.

    

Previous
 post  Next po

 

 

This website uses cookies to improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

5 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

July 6, 2018 April 21, 2016 August 9, 2019

 December 10, 2018 - 6:59 pm

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.

 December 11, 2018 - 9:23 am

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

 December 11, 2018 - 11:34 am

Probably, I will use live cd or go to single user mode to see if I can �x it. I haven’t tried it yet

 though.
Do you have any better way?

 

 

 January 7, 2019 - 10:53 am

does it work in o�ine mode pc??

This website uses cookies to improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

6 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

 January 7, 2019 - 11:38 am

Yes, It should work.


 April 5, 2019 - 9:45 pm

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.

 April 25, 2019 - 6:34 pm

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 di�erence” 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

 
 June 21, 2019 - 7:11 am

 Thank you this should


 be a marked post

 

  August 13, 2019 - 3:01 am

Very good procedure. Save me a lot of time.


Thank.
Richard.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

7 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

Ad

Fix, Clean, & Speed Up Windows. Really Simple Instructions. Download Now.

Visit Site


 September 18, 2019 - 8:50 am

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.

 November 15, 2019 - 4:57 pm

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.

 
 December 23, 2019 - 4:33 pm

 
sudo dpkg –con�gure -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.

 December 23, 2019 - 4:41 pm

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.
This website uses cookies to improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

8 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

 May 17, 2022 - 4:35 am

When i do ctrl alt f1 I get only ubuntu; advanced options for ubuntu; and ue� �rmware
settings. Those are the options. No login. No tty. Nowhere that I would be able to enter
any commands. I’ve tried all the options within these three and nothing works.

 May 17, 2022 - 10:48 am

I just veri�ed it. I can able to switch to tty1 by pressing CTRL+ALT+F1 keys. It
could be di�erent on UEFI BIOS. I don’t have an UEFI system, so I can’t give
solution at the moment. Sorry.

 December 29, 2019 - 9:31 pm

This worked brilliantly for me – thanks. One comment, I am using grub and during the update it asked wha
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.

 

 December 29, 2019 - 9:32 pm


 
BTW – I found that I had to use ctrl-alt-f3 to swicth to tty1.
 

 January 13, 2020 - 9:25 pm

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 o�ered 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
This website
fromuses cookies
kubuntu to improve
18.04 usb stickyour experience.
into “kubuntu try”Byand
using thismy
found site, we will
main 1Tbassume
disc wasthat
stillyou're OK I did have
accessible;

with it. Accept Read More

9 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

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.

 March 8, 2020 - 10:29 am

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

 April 9, 2020 - 10:23 pm

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 indicato
is back.

  April 10, 2020 - 


12:06 am

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!!

 


 April 13, 2020 - 10:06 am

Hi, DFD. Which distribution you recommend then?

 April
This website 26, cookies
uses 2020 - 7:02
toam
improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

10 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

Is “sudo dpkg –con�gure -a” supposed to be listed twice?

 April 26, 2020 - 11:57 am



Yes, I ran those commands in the same order and it worked.

 April 26, 2020 - 12:24 pm

I hope this should work on Linux Mint?

 April 26, 2020 - 1:27 pm

Yes, It should work on most Ubuntu derivatives.

 April 28, 2020 - 5:31 am

If you can’t access the tty or have another problem, check this out: https://ostechnix.com/how-to-boot-into
rescue-mode-or-emergency-mode-in-ubuntu-18-04/
 

 

  April 30, 2020 - 


12:54 pm

This article helped me immensely. Thank you very much!


 April 30, 2020 - 7:18 pm

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

This website uses cookies to improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

11 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

 April 30, 2020 - 10:58 pm

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 pro�les”
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 �nally I have my system upgraded to Ubuntu 20.04 LTS, up and
running with all the �les and previously installed softwares intact.

 May 15, 2020 - 6:01 am

Thanks, it helped.

 May 16, 2020 - 10:35 pm

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
 

 

  June 9, 2020 - 11:22 am

When I tried this my login goes in a loop. What went wrong? I am only able to open tty2. Ctrl + Alt + F2

 June 9, 2020 - 11:36 am

This website uses Icookies to improve


don’t know your
the exact experience.
reason. By using
However, thistry
you can site, wethe
to �x willOS
assume thatas
from tty2 you're
well.OK

with it. Accept Read More

12 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

 June 15, 2020 - 9:47 pm

Thank you! I had an older laptop that i tossed out but kept the msata drive and transferred it to virtual box
I followed the above and was able to login in with no problem.

 July 1, 2020 - 7:00 am

In your article titled “How To Fix Broken Ubuntu OS Without Reinstalling It” you stated the �rst thing I
should do is login with live cd and backup my data.
You later stated “At the login screen, press CTRL+ALT+F1 to switch to tty1”.
How do I get to this login screen and login?
When I press the CTRL+ALT+F1 I am asked for a user name and password.
What would the user name and password be?

 July 1, 2020 - 11:38 am

At the login screen, press CTRL+ALT+F1 to switch to tty1


It is your actual log in screen where you enter your password to log into your system.
When I press the CTRL+ALT+F1 I am asked for a user name and password.
It is your actual username and its password that you use regularly to log in to your system.
 
I said backup your data using live cd before following any of these steps. Because, if the steps
mentioned in this article didn’t work, you can simply reinstall the system and copy the data from
 
the backup.

 


 July 1, 2020 - 9:12 pm

what kind of magic is that man.


my mariadb installation went sideways,even after reinstalling, purging and everything, it was still sucking a
me.
Ran ur commands blindly, and problem solved. thanks a lot, keep doing the great work dude.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

13 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

 July 1, 2020 - 9:54 pm

Glad it worked out well for you. Cheers, mate!

 July 18, 2020 - 7:46 pm

Wow. You are a lifesaver. On a brand new installation i screwed up my Webuzo installation and needed a
rebuild. Blindly ran your steps and voila all things back to normal. Thanks a ton!!

 July 26, 2020 - 9:10 pm

sudo apt clean


sudo: apt: command not found

 August 25, 2020 - 7:46 am

This worked like a charm. Thanks a lot.

 

  September 15, 2020


 - 8:06 am

Thank you!
 

 October 6, 2020 - 2:11 am

Wow! Totally amazing. I was upgrading to 18.04 and the power went o�. Thanks. Really saved me a lot of
time and a complete reinstall.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

14 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

 October 6, 2020 - 9:03 pm

I cannot thank you enough Senthil for that article. It saved me big time.
It felt like relying on the GPS nav through unknown(at least for me) roads, which let to motorway at the end
Light in the tunnel.

 October 6, 2020 - 11:00 pm

Glad I could help. You are welcome.

 October 28, 2020 - 9:21 pm

Hi so I can access tty3 by ctrl+alt+F3. Can I run these commands on tty3 without any problem? Also just to
make sure I dont need a live usb for installation right? Thanks in advance.

 October 28, 2020 - 10:59 pm

I tried these commands and �xed my broken Ubuntu OS without any live usb. I can’t give any
assurance if it will work for everyone. Good luck anyway.

 

 
 November 10, 2020 - 3:07 am

 
Thank you very much.. solved my problem �

 November 18, 2020 - 10:07 pm

I am having a problem when I enter $ sudo apt install -f. When I enter this into my system I get an error
message of error: system does not fully support snapd: cannot mount squashfs image using “squashfs” an
I get a message also reading E: Sub-process /usr/bin/dpkg returned an error code (1). If you have any
This website uses cookies to improve your experience. By using this site, we will assume that you're OK
information that would be great! Thank you! 
with it. Accept Read More

15 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

 November 18, 2020 - 10:52 pm

Hey, I don’t have any solution for the �rst problem right now. I never encountered such error
before. For the second error message, please look at this link -> https://ostechnix.com/�x-sub-
process-usr-bin-dpkg-returned-an-error-code-1-in-ubuntu/

Good luck.

 December 28, 2020 - 4:45 am

Thank you for wasting my time! none of your so called tips work for me. TTY1 is the login screen so how ca
you go to a place you are already at?

 December 28, 2020 - 11:03 am

As I clearly stated in the article itself, It did work for me. As you can see in the comment section, it
indeed worked for many users. Probably, your problem is something else. I switched to tty1 from
GUI by pressing CTRL+ALT+F1 keys. If you can’t go to tty1, try other ttys and see if it helps.

 
 February 28, 2021 - 2:38 am

 You, good sir, are


 my hero! Please let me know where I can send you a small tip as a thank you.

 

  February 28, 2021 - 11:22 am

You are welcome. Glad I could help. https://ostechnix.com/donate/

 March 3, 2021 - 10:48 am


This website uses cookies to improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

16 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

Thank you very much for your donation Mr.Jonathan. Very kind of you.

 July 23, 2021 - 1:46 am



Just wanted to say thank you very much! I know all the commands on their own, but not the right sequence

This kind of work really helps us all out, thank you!

 July 23, 2021 - 12:41 pm

Glad it worked out for you. Happy to help!

 August 7, 2021 - 5:05 am

Gracias, me ahorro un monton de tiempo

 September 6, 2021 - 7:42 am


 
sudo apt autoremove
 , in case you have
 outdated �les that weren’t removed

 

  January 28, 2022 - 2:39 am

Worked…purged brave as well

 February 17, 2022 - 12:23 pm


This website uses cookies to improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

17 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

Brilliant, I had stripped out and ITX box (21.10 Impish with older Gigabyte AB350N ),taken out the video
card and on restart ,Ubuntu had unusual pale colours, Guessing it was needing some kind of re-initialising
of the gaphics, I found this page on the interweb. After stepping through the suggested cli entries, it came
up after restart restored to good health. Jolly good general purpose tonic for this little beast, thanks,

 April 28, 2022 - 3:04 pm

Thank you very much.. solved my problem �

Your Comment

Name* Email*

 
Save my name, email, and website in this browser for the next time I comment.
 using this form you agree
* By  with the storage and handling of your data by this website.

 

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

This website uses cookies to improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

18 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...


Home  Ubuntu   To Upgrade To Ubuntu 20.04 LTS Server
How

UBUNTU
 LINUX LINUX ADMINISTRATION
 LINUX DISTRIBUTIONS

 
Written by Sk April 25, 2020 April 26, 2023 13.6K views


 1 comment        

We've already shown you how to from Ubuntu 18.04 LTS or Ubuntu
19.10 desktop systems. Now let us see how to from Ubuntu 18.04 LTS or
Ubuntu 19.10 server
This website with screenshots.
uses cookies The method
to improve your of upgrading
experience. between
By using this site, we LTS releasesthat
will assume andyou're
normalOKedition to

LTS is quite same, except a small change in Ubuntu
with it. release
Accept upgrader.
Read More

19 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

1. Prerequisites

1. 1. Backup Important Data



2. 2. Update Your Current Ubuntu System

3. 3. Setting up Software Sources

2. Upgrade To Ubuntu 20.04 LTS Server

3. Troubleshooting

Before upgrading to latest Ubuntu version, we must take care of some important things �rst.

 

 

 

First of all, It is strongly recommended to , con�guration �les, and anything that



you can’t a�ord to lose.

Next, update your current Ubuntu server:

This website uses cookies to improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

20 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

$ sudo apt update && sudo apt dist-upgrade

Once the update is completed, reboot it to apply the updates.


$ sudo reboot

I strongly recommend everyone to use tool when attempting to upgrade a remote server via SSH. This
will keep running the upgrade the process in case your SSH session is dropped for any reason.

To install the screen tool, Enter:

$ sudo apt-get install screen

Once it’s installed, start the screen session with command:

$ screen

If your SSH connection is broken when upgrading, you can re-attach to the upgrade session easily with
 
command:

 

$ screen -Dr
 

Install the "update-manager-core" and "ubuntu-release-upgrader-core" packages  if they are not


installed already:

$This
sudo apt
website install
uses cookies toupdate-manager-core
improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

21 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

$ sudo apt install ubuntu-release-upgrader-core

Then, edit the �le /etc/update-manager/release-upgrades,


$ sudo nano /etc/update-manager/release-upgrades

If you’re upgrading from Ubuntu 18.04 LTS to 20.04 LTS, you need to set prompting behavior for for the release
upgrader as .

[...]
Prompt=lts

 

 

 

This website uses cookies to improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

22 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

 

 

 

If you’re upgrading from Ubuntu 19.10 to 20.04 LTS, set prompting behavior as .

Save and close the �le.

Now, start the upgrade process with command:

This website uses cookies to improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

23 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

$ sudo do-release-upgrade -d

If you’re running the upgrade process under SSH session, the following warning message will appear. Just type
to continue.

[...]
Continue running under SSH?

This session appears to be running under ssh. It is not recommended


to perform a upgrade over ssh currently because in case of failure it
is harder to recover.

If you continue, an additional ssh daemon will be started at port


'1022'.
Do you want to continue?

Continue [yN]

 

 

 

This website uses cookies to improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

24 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

 

 

 
Ubuntu upgrade process running under SSH session

Now, an additional sshd will be started on port 1022 to make recovery easier, just in case of failure. If
anything goes wrong with the running ssh, you can still connect to the additional one. If you run a �rewall, you
may need to temporarily open this port. As this is potentially dangerous it's not done automatically. You can
open the port with the commands:

This website uses cookies to improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

25 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

# iptables -I INPUT -p tcp --dport 1022 -j ACCEPT

Or,


# ufw allow 1022

If you are running the Upgrade on a local server, you need not to do the above steps.

Again press ENTER to continue:

 

 

 

This website uses cookies to improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

26 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

 

 

 
Additional sshd will be started during Ubuntu upgrade process

After a few seconds, the upgrade wizard will display the summary of how many packages are going to be
removed, how many packages will be upgraded, how many new packages are going to be newly installed and
the total download size.

Press to start the upgrade process. This will take a while to complete depending upon the speed of your
Internet connection.
This website uses cookies to improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

27 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

 

 

 
Start Ubuntu 20.04 LTS server upgrade

During the upgrade process, some services installed on your system need to be restarted when certain librarie
are upgraded. Since these restarts may cause interruptions of service for the system, you will normally be
prompted on each upgrade for the list of services you wish to restart. You can choose this option to avoid bein
prompted; instead, all necessary restarts will be done for you automatically so you can avoid being asked
questions on each library upgrade.
This website uses cookies to improve your experience. By using this site, we will assume that you're OK

To automatically restart the serviceswith
during Acceptupgrades
it. package Read More
without asking, choose and press ENTER

28 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

to continue.

 

 

 


Restart services during package upgrades without asking

Once the upgrade is complete, you would see the following message. Press to complete Ubuntu upgrade
process and restart the server:

This website uses cookies to improve your experience. By using this site, we will assume that you're OK
[...] 
with it. Accept Read More

29 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

System upgrade is complete.


Restart required.

To finish the upgrade, a restart is required.

If you select 'y' the system will be restarted.


Continue [yN]

 

 

 

This website uses cookies to improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

30 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

 

 

 

Ubuntu 20.04 server upgrade is completed

Log in to the newly upgraded Ubuntu 20.04 LTS system:

This website uses cookies to improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

31 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

 

 

 
Ubuntu 20.04 LTS Server

You can check verify the Ubuntu version using command:

$ lsb_release -a

This website uses cookies to improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

32 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

No LSB modules are available.


Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal

Congratulations! Start using Ubuntu 20.04 LTS server edition.

Just in case if your Ubuntu system is crashed due to power failure or network connectivity issue in the middle o
the Upgrade process, you might end up with broken Ubuntu. In such cases, refer the following guide to �x it.

FOCAL FOSSA LINUX UBUNTU UBUNTU LTS UBUNTU SERVER UPGRADE TO UBUNTU 20.04 SERVER

 1 comment        

 
Senthilkumar Palani (aka SK) is the Founder and Editor in chief of OSTechNix. He is a Linux/Unix
 and FOSS supporter. He lives in Tamilnadu, India.
enthusiast

     


Previous post Next po

This website uses cookies to improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

33 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

 November 4, 2021 - 7:48 am

Thanks. I’d tried this 3 times before, but something always went wrong. With your help, I �nally got all the
way through.

 

Your Comment
 

 

Name* Email*

Save my name, email, and website in this browser for the next time I comment.

* By using this form you agree with the storage and handling of your data by this website.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

34 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

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

Archives
Select Month

 

 

OSTechNix
 (Open Source, Technology,
 Nix*) regularly
publishes the latest news, how-to articles, tutorials and
tips
 & tricks about free and opensource software and
technology.

      

This website uses cookies to improve your experience. By using this site, we will assume that you're OK

with it. About
Accept Contact
Read Us
More Privacy Policy Sitemap Terms and

35 of 36 5/10/23, 03:52
How To Fix Broken Ubuntu OS Without Reinstalling It -... https://ostechnix.com/how-to-fix-broken-ubuntu-os-withou...

OSTechNix © 2022. All Rights Reserved. This site is licensed under

 

 

 

This website uses cookies to improve your experience. By using this site, we will assume that you're OK

with it. Accept Read More

36 of 36 5/10/23, 03:52

You might also like