Ubuntu’s server operating system is one of the best distributions for doing big things on Linux, especially due to how easy it is to set up, install software, and maintain.
Aside from the excellent features that Ubuntu Server has to offer, it also has a pretty useful and easy to understand upgrade mechanism, that makes it one of the best to use if you’re new to using Linux server operating systems.
In this guide, we’ll go over how to use the Ubuntu Server upgrade system to transition an installation to a new release. So, back up your data, and let’s get started!
Run update tools
Before taking your Ubuntu Server installation to a new release, it is imperative that you run the update tools, so that all of the packages currently installed can be up to date.
To run a traditional update on Ubuntu Server, open up a terminal window and SSH in if your machine is remote. Or, sit down at it and log in. Once logged in, use the sudo -s command to transition the shell to a Root user.
Once the command-line session has transitioned to the Root user, use it to run the Apt update command, to have Ubuntu Server check the internet for updates.
After the Ubuntu Server package manager is done pinging the software servers for updates, it’ll print out how many updates are available for you to install.
To take a look at the pending updates for your Ubuntu Server, you can use the Apt list command with the “upgradable” switch.
apt list —upgradeable
Read through the updates and determine if they’re alright to install on your system. Then, use the Apt upgrade command to finish up the process.
apt upgrade -y
With all of the updates for Ubuntu Server set up on your system, move on to the next section of the tutorial. Or, reboot the machine if the updater prompts you to.
Following the update and upgrade commands, it’s critical that you run the dist-upgrade command, to install any distribution upgrades for the release of Ubuntu Server you’re currently running.
Note: the dist-upgrade is not the same as the upgrade command. Though similar, they handle different aspects of the operating system.
Following the dist-upgrade command, restart your Ubuntu Server once again. When it comes back online, move on to the next section of the upgrade process.
Install Update Manager
In this guide, we’ll focus on showing you how to upgrade Ubuntu Server using the Update Manager tool. On some versions of the operating system, the program may not come pre-installed. So, before going over how to use this tool, use the Apt package manager to install it.
sudo apt install update-manager-core
Following the Apt installation, Update Manager should be ready to go. For more information about the tool, run
man update-manager in a terminal session.
Change your release
A vast majority of Ubuntu Server users end up using the LTS releases of the operating system. While this is generally a good call, the non-LTS releases are also worth checking out. The problem is, Ubuntu disables the ability to upgrade to non-LTS releases by default.
To change the release path for your Ubuntu Server, open the “release-upgrades” file in the Nano text editor.
nano -w /etc/update-manager/release-upgrades
Look through the configuration file for
Prompt=lts and change it to the code below.
Note: if you are not using an LTS release of Ubuntu Server, skip this step.
With the code in the Ubuntu Server update manager tweaked, it’s time to save the code with Nano. Press Ctrl + O to save. After that, close the editor with the Ctrl + X keyboard combination.
Check for a new release
The next step in the upgrade process is to use the update-manager program to check the Ubuntu repositories for the next Ubuntu Server release available for download.
To do a check, run the do-release-upgrade with the ‘c‘ command-line switch.
Note: be sure to run do-release-upgrade with a Root shell. If you don’t, it may not work correctly.
sudo -s do-release-upgrade -c
Allow the program to run a check and determine if your OS has an upgrade available. Then, if the program says that there is an upgrade available for installation, run the do-release-upgrade command with the -d command-line switch.
Keep in mind that when running this upgrade, things are going to take a long time. It is up to you to keep an eye on your system and ensure nothing goes wrong.
Things to keep in mind when upgrading Ubuntu Server
Using the update-manager program makes upgrading Ubuntu Server a painless process. However, it’s not 100% flawless, and issues and breakages though uncommon, can certainly happen.
To avoid this, we highly recommend consulting with the official Ubuntu Wiki and reading what they have to say about upgrading between releases, as they will have a lot of tips and tricks that will help you along the way.