Azure Ubuntu vm: downgrade linux kernel

When moving vms on different regions it may occur that the current linux kernel version of Azure Ubuntu vm is not supported.

The list of supported ubuntu kernel verions

How to find the current installed kernel version:

uname -r

In my case i had installed the linux kernel version : 5.13.0-1021-azure.

The commands for downgrade and removal of the other version:

sudo apt install linux-image-5.4.0-1058-azure linux-tools-5.4.0-1058-azure linux-cloud-tools-5.4.0-1058-azure linux-headers-5.4.0-1058-azure linux-modules-5.4.0-1058-azure linux-modules-extra-5.4.0-1058-azure


sudo apt remove linux-headers-5.13.0-1021-azure linux-image-5.13.0-1021-azure linux-image-unsigned-5.13.0-1021-azure