Upgrade Ubuntu OS 20.0.4.5 TLS -> 22.04 Jammy / with running Cardano Node 1.35.5

Hello all,

if you are running Cardano Node 1.35.5 and you want to upgrade the Ubuntu 20.0.4.5 to 22.0.4
please take a look steps how we have successfully bring the Node back in Operation without any issue.

Prerequisites
Before you begin the upgrade, ensure you meet the following requirements:

  1. At least 20 GB of free disk space. You can check the available disk space using the df -Th command.
  2. Ensure you have a regular user configured with sudo privileges with access to SSH or the terminal app. This is the user you will use to perform the upgrade process.
  3. In addition, ensure you have a fast and stable internet connection. Do not cancel the operation once it’s begun.
  4. Close all open applications.

## Step 1: Backup all your data

Take a backup of all your files before embarking on any major upgrade of an operating system. This ensures you will not lose your data in case something goes wrong during the upgrade process.
Cloud server providers offer snapshot services. Therefore, if you are running a virtual machine or cloud VPS, ensure you take a complete snapshot so that you can restore your instance in case it breaks.

## Step 2: Upgrade all the system packages

Once the backup is in place, log in to your instance and upgrade all the packages to their latest versions. This upgrades the entire system to the latest Ubuntu release.

To list upgradable packages, run the command:

sudo apt list --upgradable

Next, refresh the local package index and upgrade the packages in one single command as follows:

sudo apt update && sudo apt upgrade -y

image

This might take a while depending on the number of installed packages with pending upgrades. Once the upgrade is complete, reboot your system to take advantage of the latest kernel that will come with the upgrade.

sudo reboot
Then log back into the system and confirm it has been upgraded to the latest release, which, at the time of publishing this guide, is Ubuntu 20.04.4 LTS.
lsb_release -a

image
image

## Step 3: Open TCP port 1022

If you are connected to your Ubuntu instance via SSH, the upgrade tool will open another SSH port (1022) as a fallback port in case the SSH connection drops on port 22.

sudo ufw allow 1022/tcp
To apply the firewall rule, reload the firewall.
sudo ufw reload

image

## Step 4: Upgrade to Ubuntu 22.04 Jammy Jellyfish

At this point, upgrading to Ubuntu 22.04 will be a straightforward and seamless process.
In this guide, we will use the do-release-upgrade tool. If it is not installed, you can install it by running the command:

sudo apt install update-manager-core
image

To commence the upgrade, run the command:

sudo do-release-upgrade -d

During the upgrade, the upgrade tool will probe for the latest LTS release and walk you through a series of prompts.

First and foremost, it will detect your SSH connection and notify you that an additional SSH service will be started on port 1022. Simply type “Y” to proceed.

Next, the upgrade tool will notify you to open port 1022, which will be used as an alternative SSH port in case of an SSH connection interruption on the default port. Since you already opened the port, just hit ENTER.

image
Next, you will be prompted to update the “sources.list” file from ‘focal’ to ‘jammy’ entries. To proceed with the upgrade, press “Y” and press ENTER.

The update tool will calculate all the changes and provide a summary of the following:

  1. Installed packages that are no longer supported by Canonical.
  2. The number of packages to be removed.
  3. The number of new packages that will be installed.
  4. The number of packages that will be upgraded.
  5. Total download size and how long the download will take.

To continue, once again, press “Y” and press ENTER.
image
Some services will need to be restarted once some libraries and packages are upgraded. On this pop-up, select ‘Yes‘ to restart these services during package upgrades without being prompted.
image
From here, the upgrade tool will proceed to download all the requisite packages from the official Ubuntu repositories and upgrade them.
image
image
Configuration file ‘/etc/systemd/resolved.conf’
image
N or O : keep your currently-installed version
image
│ What do you want to do about modified configuration file chrony.conf? │
keep the local version currently installed
image
When prompted on what to do with the modified “sshd_config” configuration file, you can choose to install the package maintainer’s version or keep the local version installed. Then, select ‘Ok’.

│ What do you want to do about modified configuration file sshd_config? │
keep the local version currently installed
image
Next, press “Y” and hit ENTER to remove obsolete packages.
image
Thereafter, all the old packages alongside their configuration files will be removed.
image
The entire process takes quite some time, so patience will be required. This is a good time to take a break and grab some coffee.

Once the upgrade is complete, you will be prompted to restart the system to finish the upgrade. Press “Y” and hit ENTER to reboot. This will cause you to lose connection to the server.
image

## Step 5: Verify the upgrade to Ubuntu 22.04

After rebooting, log back in and confirm the upgrade was successful.
The command

lsb_release -a
image
checks the version of Linux, while the command
uname -mrs
image
checks the kernel version.

From the output below, you can see that we are now currently running Ubuntu 22.04 LTS. Also, note that we are using kernel 5.15 which is the kernel version that comes with Ubuntu 22.04 by default.

## Step 6: Delete the firewall rule you created

Now that you are finished with the update and no longer need port 1022 open, run the following command to close the port and prevent it from becoming a security vulnerability.

sudo ufw delete allow 1022/tcp

After a successful Upgrade

sudo systemctl status cnode
image
sudo systemctl stop cnode
cd .local/bin/
ll
image
rm cardano-ping
rm mux-demo

cd tmp/
./guild-deploy.sh -sd

sudo systemctl restart cnode

enjoy evening!!!

5 Likes