Can't enable Canonical Livepatch on Ubuntu 20.04.1 LTS

Solution 1:

I had this same problem today and I fixed it by doing the following:

  1. Disable Livepatch either through the GUI or by running canonical-livepatch disable as root
  2. Uninstall Livepatch with snap remove canonical-livepatch as root (optional. Try it first without doing this)
  3. Run the command rm /etc/machine-id as root to remove your current machine ID (if it says the file or directory doesn't exist, you can safely ignore it)
  4. Run the command systemd-machine-id-setup as root to regenerate the ID
  5. Reinstall Livepatch with snap install canonical-livepatch as root (if you removed it earlier)
  6. Either grab your key from https://auth.livepatch.canonical.com and follow the instructions there to re-enable or use the Livepatch GUI

If this works for you, please mark this answer as correct so I can get enough reputation to do stuff.

Edit: @scoobydoo had to run rm /etc/machine-id /var/lib/dbus/machine-id in step 3.