Lxd won't work: Error: Get http://unix.socket/1.0: dial unix /var/lib/lxd/unix.socket

I installed lxd and started it, enabled it through systemd, uninstalled it, installed it again. A few times.
Initialized lxd with lxd init

The same problem persists through it all.
Every time I try a lxc command, whatever it is, it returns this error:
“Error: Get http://unix.socket/1.0: dial unix /var/lib/lxd/unix.socket: connect: no such file or directory”

I have it installed on another machine as well, with no problems there. I’m at a loss

What distro and are you using the snap or native pacakge?

The error above suggests native package, if you’ve installed the snap then you need to make sure that the native packages aren’t installed anymore (lxd-client package).


ubuntu 18.04. I have the snap version installed

Ok, then remove the lxd-client package from your system and run hash -r to update the paths of the various commands, that should fix it.

that was it. I had lxd-client installed through apt. Got rid of it and all works now. Thanks very much!

This works perfectly for me.