Problem trying to use Livepatch

This is the error message:

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": {"error": "Conflicting machine-id"}

I can't get further after this. Can someone help please?


A better option for fixing livepatch after upgrades to Ubuntu versions is to use the ua client, since it is able to reassociate an existing machine ID with the livepatch.

First check ua status and if it says "This machine is not attached to a UA subscription." then just go to https://ubuntu.com/advantage and get a new token for your account and attach it with ua attach $token. That fixed livepatch for me without having to regenerate the machine ID and thus take up another of the 3 free machines allowed for livepatch. (Also, if you're getting rid of a machine, make sure you disable livepatch on that machine first for the same reason.)