To be able to migrate your Cloud Server to VPS, the latest kernel version must be installed on your server. If you are using an old kernel version on your Cloud Server, you must install the latest kernel version on the server.

This article explains how to install the latest kernel version on a Cloud Server with Ubuntu or Debian and how to repair a kernel.

Note

If you have installed the latest kernel version and it is damaged, you must repair the kernel. You can find instructions on how to do this in the following article:

Cloud Server: Repairing the current kernel version (Ubuntu)

Back up your server data

Back up your server data before you repair the kernel. You can either use the paid Cloud Backup or save the data locally on your computer with Filezilla.

You can find more information about Cloud Backup in the following article:

Cloud Backup: Getting started

Ensure that the operating system is up to date

  • Establish an SSH connection to your Cloud Server and log in as administrator.

  • To ensure that the operating system is up to date, enter the following commands:

    root@localhost:~# sudo apt update
    root@localhost:~# sudo apt upgrade

Check available storage space

To be able to migrate your Cloud Server to VPS, at least 100 MB of memory must be free in the root and boot directories of your server.

To display the free space of the entire file system, enter the following command:

[root@localhost ~]# df -h


To display the used storage space of the entire file system, use the following command:

[root@localhost ~]# du -sh /


You can find instructions on how to delete old kernels and free up memory space in the following article:

Freeing up storage space on a Cloud Server (Linux)

Install the latest kernel version

Check kernel version

To check the kernel version, enter the following command:

root@localhost:~# uname -r

Installing the latest kernel version

In the following you will learn how to install the latest kernel version.

Attention
  • Always check the release notes before updating the kernel
  • Most distributions support the parallel installation of new and existing kernel versions. Do not delete the existing kernel until you have finished testing the new kernel.
  • Establish an SSH connection to your Cloud Server and log in as administrator.
  • To display a list of available kernels, enter the following command:

    Ubuntu 20.04, Ubuntu 22.04, Ubuntu 24.04

    root@localhost:~# apt search linux-generic


    Debian 10, Debian 11 and Debian 12

    root@localhost:~# sudo apt search linux-image

  • To install the standard kernel package, enter the following commands:

    Ubuntu 20.04, Ubuntu 22.04, Ubuntu 24.04

    root@localhost:~# sudo apt install --install-recommends linux-generic


    Debian 10, Debian 11 and Debian 12

    root@localhost:~# sudo apt install --install-recommends linux-image-amd64

    By entering these commands, Ubuntu and Debian perform intelligent dependency handling when updating the kernel.

  • Update the grub configuration. To do this, enter the following command:

    root@localhost:~# sudo update-grub

  • To restart the server, enter the following command:

    root@localhost:~# reboot

  • To check whether the installation was successful, enter the following command:

    root@localhost:~# uname -r

  • To check whether the correct kernel headers have been installed, enter the following command:

    root@localhost:~# ls -l /usr/src/linux-headers-$(uname -r)

  • If you receive an error message similar to the one below after entering the command, the kernel header has not been installed.

    Ubuntu 20.04, Ubuntu 22.04, Ubuntu 24.04

    ls: cannot access '/usr/src/linux-headers-6.8.0-38-generic': No such file or directory


    Debian 10, Debian 11 and Debian 12

    ls: cannot access '/usr/src/linux-headers-6.1.0-23-amd64': No such file or directory


    In this case, enter the following command(s) to install the kernel header:

    Ubuntu 20.04, Ubuntu 22.04, Ubuntu 24.04

    root@localhost:~# sudo apt install linux-headers-$(uname -r)


    Debian 10, Debian 11 and Debian 12

    sudo apt search linux-headers
    sudo apt install linux-headers-<version>

  • Then check whether the installation was successful. To do this, enter the following command:

    Ubuntu 20.04, Ubuntu 22.04, Ubuntu 24.04

    root@localhost:~# ls -l /usr/src/linux-headers-$(uname -r)


    Debian 10, Debian 11 and Debian 12

    root@localhost:~# dpkg -l | grep linux-headers