Cannot issue lxc storage list after installing lxd 3.17 via snap

These are the steps I took:

  1. apt purge lxd
  2. snap install lxd
  3. lxd init

Then when I issue:
lxc storage list

I get this:
Error: Get http://unix.socket/1.0: dial unix /var/lib/lxd/unix.socket: connect: no such file or directory

lxd --version
3.17

lxc --version
3.0.3

You forgot to remove lxd-client too.

The canonical (no pun intended) way to upgrade from the deb package to the snap package, is to

  1. install the snap package
  2. run sudo lxd.migrate, which asks you to uninstall for you the LXD packages (both server and client).

If you want to remove LXD manually, then you need to run the following. The following autoremoves any LXD dependencies, and this includes the lxd-client package.

sudo apt remove --purge --auto-remove lxd

The problem you got is that you did not remove the lxd-client deb package, therefore the binary /usr/bin/lxc takes precedence in the $PATH over the binary /snap/bin/lxc.

Thank you I knew there was something I had forgotten! :smile: