I run an Ubunutu server and initially I found it tedious to have to do upgrades by going to the server and manually running the upgrade. I did not want to get too fancy with this process as it was not worth the time. I just log in and set it then come back later and ensure thing are going smoothly and answer any questions that may come up.
I was thinking about doing this via ssh but there is always the possibility that your connection may drop and you can potentially break your server, Ubuntu actually puts up a warning for you in this regard.
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
Do you want to continue?
What I did was use a screen session should things disconnect me from my session so that the process can remain running and I can reconnect once I am able to. I have not had an issue as yet (knocks on wood) but you just never know and I prefer to be safe than sorry.
sudo apt update && sudo apt install screen
Start a session and accept the license as prompted
If you need to reconnect just run the following command
If you have more than one session running find the one you want by running the following command
To connect to one of your running sessions run the following command where 17448 is the screen session id
screen -r 17448
Ensure Update Manager is installed
sudo apt install update-manager-core
Ensure your upgrade config is set to the tree you want to be on
From that file, as you can see, I use
# Default behavior for the release upgrader.
# Default prompting behavior, valid options:
# never - Never check for a new release.
# normal - Check to see if a new release is available. If more than one new
# release is found, the release upgrader will attempt to upgrade to
# the release that immediately succeeds the currently-running
# lts - Check to see if a new LTS release is available. The upgrader
# will attempt to upgrade to the first LTS release available after
# the currently-running one. Note that this option should not be
# used if the currently-running release is not itself an LTS
# release, since in that case the upgrader won't be able to
# determine if a newer release is available.
Run a base upgrade
Run a full Upgrade
sudo do-release-upgrade -d
Follow the instructions that appear on screen. You will be asked about keeping files or installing the new version, that will be up to you as only you know your server and what you’ve changed.
Warning : Pay close attention as upgrading a file that has config settings that let your sever do the work you built it for may be overwritten.
Did it work?
Ensure that the upgrade works and that you are on the most recent release as per your upgrader settings.
Run the lsb command:
The lsb_release command provides certain LSB (Linux Standard Base) and distribution-specific information.
Here are all the options you can use:
Show the version of the LSB against which your current installation is compliant. The version is expressed as a colon separated list of LSB module descriptions.
Display the distributor's ID.
Display a description of the currently installed distribution.
Display the release number of the currently installed distribution.
Display the code name of the currently installed distribution.
Display all of the above information.
Use the short output format for any information displayed. This format omits the leading header(s).
Show summary of options.
You should see something like this:
Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Description line would show the sub version number if there are security releases done after the initial release. In those cases you should see something like this which I got from my server prior to the upgrade:
Description: Ubuntu 16.04.4 LTS
There you go. Did I forget something or do you have something to add to make this article better, leave a comment below.