Ubuntu Server 20.04 LTS has been a dependable, steady launch for a lot of organizations, offering important assist for essential workloads. However as expertise develops, so does the necessity to improve Ubuntu to a brand new launch to make sure the system stays up-to-date and safe.
Ubuntu Server 22.04 LTS presents a number of new options and enhancements, making this launch interesting to these seeking to improve. And on this tutorial, you’ll stroll via the steps concerned in upgrading Ubuntu Server 20.04 LTS to 22.04 LTS.
Learn on and luxuriate in the brand new options that include your Ubuntu improve!
Conditions
This tutorial contains hands-on demonstrations. To comply with alongside, guarantee you may have an account that could be a member of the sudoers group.
Performing a Pre-upgrade Checkup
Though upgrades are sometimes protected, there’s at all times an opportunity that one thing might go fallacious. For good measure, earlier than upgrading your Ubuntu system, a pre-upgrade checkup is a should.
To organize your Ubuntu system for an improve:
1. First, safely copy your information to a backup location to permit restoration if any issues or issues come up through the improve course of.
2. Subsequent, verify the launch notes and guarantee no adjustments might negatively affect your present system.
3. Open a terminal, and run the under df
command to verify how a lot house you may have in your boot (/boot) and root (/) volumes.
Guarantee you may have sufficient free house obtainable to improve. Why? Upgrading from one launch to a different will obtain new packages and exchange the present ones in your system. This course of consumes disk house.
When you wouldn’t have sufficient house in your /boot partition, soar to the next step for a cleanup. In any other case, soar to step 5 as a substitute.
4. Run the next apt autoremove
command to wash up (--purge
) previous kernel pictures.
When you use private package deal archives (PPAs) or another third-party repositories, any software program put in from these repositories just isn’t eliminated or downgraded. Software program put in from these repositories is the only most typical explanation for improve points.
sudo apt autoremove --purge
5. Lastly, run the next steps to open port 1022
in your UFW firewall, reload the firewall, and verify the firewall standing.
In case you are linked to your Ubuntu occasion through SSH, the improve instrument will open one other SSH port (1022) as a fallback port in case the SSH connection drops on port 22.
However bear in mind to shut the port after your Ubuntu improve. Doing so ensures you keep away from inadvertently opening your system to potential safety points.
# Add a firewall rule to permit port 1022
sudo ufw permit 1022/tcp
# Reload the firewall
sudo ufw reload
# Examine the firewall standing
sudo ufw standing
Putting in the update-manager-core Package deal
With the pre-upgrade checkup out of the way in which, the following step is to make sure the improve runs easily. You should set up the update-manager-core package deal, important for upgrading an Ubuntu Server distribution from one model to a different.
However first, you should guarantee your system has the most recent repositories and packages, as follows:
1. Run the under instructions to carry out the next:
apt replace
– Replace the APT package deal index to make sure you have the most recent repositories.apt improve
– Improve the put in packages in your system to their newest variations.
sudo apt replace && sudo apt improve -y
The general course of can take a couple of minutes or longer, relying on how up-to-date your Ubuntu Server host is.
2. As soon as up to date, run the under command to reboot
your Ubuntu system.
3. Lastly, run the under apt set up
command after the reboot to put in the update-manager-core
package deal.
sudo apt set up update-manager-core
Performing an Improve on Ubuntu
After putting in the update-manager-core package deal, you may lastly start to improve your Ubuntu system. However do you really want an improve?
Some individuals select to not improve as they’re content material with their present Ubuntu system. However the catch is that they won’t profit from new options and enhancements in new releases.
To carry out an Improve on Ubuntu:
1. Run the do-release-upgrade
command under to verify (-c
) for a brand new launch of the Ubuntu Server.
sudo do-release-upgrade -c
If a brand new launch is out there, you’ll get an output just like the one under.
Upgrades from one LTS to the following LTS launch are solely obtainable after the primary level launch. For instance, Ubuntu 18.04 LTS will solely improve to twenty.04 LTS after the 20.04.1 level launch.
2. Now, run the next do-release-upgrade
with out further parameters to carry out the precise launch improve to the following obtainable model of Ubuntu.
3. Press Enter when prompted, as proven under, to begin the improve and obtain the packages for the brand new launch.
4. Assessment the improve data, enter y, and press Enter to proceed.
The immediate under exhibits the full packages to be eliminated, put in, and upgraded and the full dimension of the sources to obtain for the improve.
Be aware that the improve course of might take a while to finish, relying on the pace of your system and the quantity of knowledge being transferred.
5. Now, select <Sure>, and press Enter to restart providers throughout package deal upgrades.
Throughout the improve course of, you might be prompted to reply some questions or verify sure actions, such because the one under. These prompts happen when current configuration information are edited by the consumer and the brand new package deal configuration file are totally different.
Or select to maintain the native model of the configuration information at present put in.
The default motion is to maintain the present model, however it would be best to examine the variations within the information. Older configurations might have deprecated choices that may trigger the software program to fail or the system to not boot correctly.
6. Enter y or N to take away or maintain out of date packages now not wanted by the brand new launch.
7. As soon as the improve is full, enter y and press Enter to reboot your Ubuntu system.
8. Lastly, after the reboot, run the under command to get the Linux Normal Base (LSB) particulars.
Under, the output verifies you at the moment are operating Ubuntu Server 22.04 LTS, with the Codename jammy.
Congratulations! You may have efficiently carried out a brand new launch improve on Ubuntu!
Conclusion
On this tutorial, you may have realized the right way to keep caught up on new options and enhancements by performing an improve on Ubuntu programs.
At all times bear in mind to again up your system earlier than continuing with the improve and to check the method in a non-production atmosphere.
Publish-upgrade, you’ll by no means know when you’ll face some startup points. Why not begin studying about the right way to repair them?