Valid for Cloud Backup, Cloud Servers, VPS, and Dedicated Servers with Ubuntu 22.04, Ubuntu 24.04, Debian 12, Debian 13, AlmaLinux 8, AlmaLinux 9, AlmaLinux 10, Rocky Linux 8, Rocky Linux 9, and Rocky Linux 10.
 

This article explains how to fix the error message "snapapi fails to build" that occurs when installing the Cyber Protection Agent.

If you receive the error message snapapi fails to build when installing the Cyber Protection Agent, you must ensure that the running kernel matches the latest installed version.

Two possible fixes and their steps are listed below.

Option 1: Check kernel version and select the new kernel on reboot (recommended)

  • Check the currently used kernel version. To check this, enter the following command:

    uname -r

  • Install the kernel level package and check the version. To do this, enter the following commands:

    AlmaLinux 8, 9, and 10, and Rocky Linux 8, 9, and 10
    Install the kernel-devel package:

    dnf install kernel-devel

    Check version:

    rpm -qa |grep kernel

    Debian 12 and Debian 13
    Install kernel-devel package (recommended if you are using the current standard kernel):

    sudo apt update 
    sudo apt install linux-headers-amd64

    If an older or different kernel is running:

    sudo apt install "linux-headers-$(uname -r)"

    Check version:

    dpkg -l linux-headers-*

    Ubuntu 22.04 and Ubuntu 24.04 
    Install kernel level package:

    sudo apt update 
    sudo apt install linux-headers-generic

    Check version:

    dpkg -l linux-headers-*

  • If the header/level package has a higher version number than the current kernel, you must install a newer kernel. To do this, enter the following command(s):

    AlmaLinux 8, 9 and 10 and Rocky Linux 8, 9 and 10

    dnf update kernel

    If you have already installed the latest kernel version, enter the following command to install a correct and compatible version of the kernel level package:

    sudo dnf install "kernel-devel-$(uname -r)"

    Debian 12 and Debian 13

    sudo apt install linux-image-amd64

    Ubuntu 22.04. and Ubuntu 24.04

    sudo apt install linux-image-generic

  • Applies to Debian 12, Debian 13, Ubuntu 22.04. and Ubuntu 24.04

    Update the package lists and then update the distribution (incl. kernel updates).

    sudo apt update && sudo apt dist-upgrade

  • Carry out a restart. Depending on the distribution, different steps are required for this:

    AlmaLinux and Rocky Linux 8, 9, and 10
    If necessary, perform a reboot and select the new kernel in the GRUB menu during the boot process if this is not done automatically.

    Debian 12, Debian 13, Ubuntu 22.04, and Ubuntu 24.04
    If necessary, reboot and select the new kernel in the GRUB menu during the boot process.

  • Check whether the version is now up to date after the reboot. To do this, enter the following command:

    uname -r

  • Install the Cyber Protection Agent. You can find instructions in the following articles:

    Cloud Server:

    Installing Backup Agent (Linux)

    Dedicated Server:

    Installing Backup Agent (Dedicated Server with Linux)


     

Option 2: Check the kernel version, download the correct Linux headers package, and move it to /usr/src (only applies to Debian)

If you do not want to reboot or use a different kernel, complete the following:

  • Check the kernel currently in use. To do this, enter the following command:

    uname -r

  • Open the URL http://snapshot.debian.org/package/linux/ and search for the correct and compatible version of the Linux header package. Then download both the "AMD64" and the "common" .deb file, and move the files to the server.

  • To unpack the Linux headers package, enter the following command:

    ar x linux-headers-VERSION.deb
    tar x data.tar.xz

    Examples:

    ar x linux-headers-4.17.0-1-amd64_4.17.3-1_amd64.deb
    tar x data.tar.xz

     

    ar x linux-headers-4.17.0-1-common_4.17.3-1_all.deb
    tar x data.tar.xz

    Debian 12/13, if .zst is used, use the following commands:

    ar x linux-headers-VERSION.deb 
    tar --zstd -xvf data.tar.zst

  • Move the unpacked data to the /usr/src directory with the following command:

    sudo mv ./usr/src/* /usr/src

  • Install the Cyber Protection Agent, and ignore the error message regarding the missing package. You can find instructions on installing the Cyber Protection Agent in the following articles:

    Cloud Server: Installing Backup Agent (Linux)

    Dedicated Server: Installing Backup Agent (Dedicated Server with Linux)

If the new kernel does not boot automatically: Set the default kernel

If the server does not start with the new kernel after the update, you must set this as the default.

AlmaLinux 8, 9, and 10, and Rocky Linux 8, 9, and 10 
These systems use grubby for administration.

  • Check the available kernels with grubby:

    sudo grubby --info=ALL

  • Set the desired kernel as the default, making a note of the path (e.g. /boot/vmlinuz-4.18...) from the list above. Then adapt the following command and execute it:

    sudo grubby --set-default /boot/vmlinuz-<VERSION>

  • Check the set kernel by entering the following command:

    sudo grubby --default-kernel

 

Debian 12, Debian 13, Ubuntu 22.04, and Ubuntu 24.04
With these distributions, the latest kernel is automatically selected by default. If this does not happen, select it in the GRUB menu under "Advanced options for Ubuntu/Debian" when booting.