Livepatch on Ubuntu 20.04

Canonical's Livepatch allows you to install kernel updates without a system reboot. First introduced in Ubuntu 16.04 it is a great utility for servers to maximise uptime and reduce server restarts. It also works on desktops, where kernel restarts can be just as inconvenient.

On the desktop, go to Software & updates > Livepatch tab.

On the current Beta of 20.04, I had to hit the Sign In button to enter my UbuntuOne (remember that?) credentials - if you don't have an Ubuntu account you'll have to create one. On Ubuntu 19.04 and 19.10, I didn't sign in to enable it. I believe this may be a result of Ubuntu now charging for Livepatch as a service for servers.

If you do go through this on 20.04, it takes you through the following steps:
  • Sign in Ubuntu One
  • Authenticate connect daemon
  • Sign in Ubuntu One again
  • Authenticate privileges to run.

That's it, Livepatch is set up on your Ubuntu 20.04 Desktop.

Depending on how you've used Livepatch previously, you may get an error on Ubuntu 20.04:

Failed to enable Livepatch: cannot enable machine: this machine ID is already enabled with a different key or is non-unique. Either "sudo canonical-livepatch disable" on the other machine, or regenerate a unique /etc/machine-id on this machine with "sudo rm /etc/machine-id /var/lib/dbus/machine-id && sudo systemd-machine-id-setup" server response: Conflicting machine-id

To fix this error, type the following commands in the terminal –

    cp /etc/machine-id /etc/machine-id.original
    cp /var/lib/dbus/machine-id /var/lib/dbus/machine-id.original
    nano /etc/machine-id (to remove the existing value)
    > Initializing machine ID from D-Bus machine ID.
    cat /etc/machine-id

For Servers, you will need to head over to Ubuntu's Livepatch page, select "Ubuntu user", click “Get your livepatch token". The page will show your Livepatch token and the commands to install and enable Livepatch on the server through a terminal session.

    sudo snap install canonical-livepatch
    sudo canonical-livepatch enable UNIQUE_TOKEN

To check the status, run the following command:

    canonical-livepatch status --verbose