2

machine is running Xenial, updated from Wily using do-dist-upgrade

Trying to set up live patching as an experiment before apply to my seedbox (a different machine)

Following these instructions cyberciti.biz/faq/howto-live-patch-ubuntu-linux-server-kernel-without-rebooting/

~$ canonical-livepatch status
Machine is not enabled. Please run 'sudo canonical-livepatch enable' with the
token obtained from https://ubuntu.com/livepatch.

~$ sudo canonical-livepatch enable [key]
sudo: canonical-livepatch: command not found

Please advise.

  • That's odd. Does sudo $(which canonical-livepatch) enable [key] work? – Chai T. Rex Nov 16 '16 at 01:10
  • Is the canonical-livepatch snap installed properly and working? snap list will show you the installed snaps and you can verify that the service is running by systemctl status snap.canonical-livepatch.canonical-livepatchd.service – Manik Taneja Nov 16 '16 at 02:13

2 Answers2

4

I did have the same error message, log files did not help me either. So I did as root:

snap remove canonical-livepatch
apt update && apt upgrade && apt dist-upgrade
reboot

afterwards again as root:

sudo snap install canonical-livepatch 
sudo canonical-livepatch enable **your token here**

output was: Successfully enabled device. Using machine-token: your token here :)

martend
  • 80
  • Yeah, same thing worked here- basically just wiping it and starting over. No idea why it worked the second time but not the first. I guess "uninstall and try again" is the software equivalent of "try restarting it" lol –  Jan 21 '17 at 18:35
  • On ubuntu 22.04.1 LTS "sudo pro enable livepatch" to enable livepatch service. – kovivox Oct 28 '22 at 06:03
0

The error message occurs because the path, /snap/bin, is not in the search path used by sudo. Obviously, it is in the path when you are a regular user. The simple solution is to use the full path when running the command as a superuser,

sudo /snap/bin/canonical-livepatch enable **your token here**