Why am I having issues upgrading the kernel on a fresh Ubuntu 16.04 installation?

Brian Tkatch asked:

I signed up for a Linux VPS. This VPS comes with an older Linux kernel, and I would like to upgrade it because some software I want to run requires a newer version. This is the output of uname -a:

Linux florence 2.6.32-042stab120.11 #1 SMP Wed Nov 16 12:05:45 MSK 2016 x86_64 x86_64 x86_64 GNU/Linux

This is a brand new, fresh Ubuntu 16.04 image. (The host is http://ssdnodes.com). These are all the commands that I have run, as root, in order (this is the tutorial I am attempting to follow):

apt-get update
apt-get upgrade -y
apt-get autoremove -y

mkdir kernel_update
cd kernel_update/
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.9/linux-headers-4.9.0-040900_4.9.0-040900.201612111631_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.9/linux-headers-4.9.0-040900-generic_4.9.0-040900.201612111631_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.9/linux-image-4.9.0-040900-generic_4.9.0-040900.201612111631_amd64.deb
dpkg -i linux-*.deb

The first two packages install fine. When I try to select the third package, I get this error:

Unpacking linux-image-4.8.15-040815-generic (4.8.15-040815.201612151231) ...
Setting up linux-headers-4.8.15-040815 (4.8.15-040815.201612151231) ...
Setting up linux-image-4.8.15-040815-generic (4.8.15-040815.201612151231) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.8.15-040815-generic /boot/vmlinuz-4.8.15-040815-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.8.15-040815-generic /boot/vmlinuz-4.8.15-040815-generic
update-initramfs: Generating /boot/initrd.img-4.8.15-040815-generic
E: /usr/share/initramfs-tools/hooks/fixrtc failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.8.15-040815-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-4.8.15-040815-generic.postinst line 1052.
dpkg: error processing package linux-image-4.8.15-040815-generic (--install):
 subprocess installed post-installation script returned error exit status 2
Setting up linux-headers-4.8.15-040815-generic (4.8.15-040815.201612151231) ...
Errors were encountered while processing:

For testing, I have attempted the same procedure (with another fresh image) with kernel v4.8.15, and have gotten a very similar error, with the two linux-headers packages installing fine but getting headers on the linux-image package.

Thanks in advance for the assistance.

My answer:

You can’t upgrade the kernel because this isn’t a real virtual machine. Instead, it’s a container using OpenVZ containers, which are rather old, and still use a kernel ABI/version from 2010.

You will need to cancel the service and obtain a VPS from a different provider, which does not use OpenVZ.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.