Problems with LXD - its installed but command not found


#1

My os is PureOS - it does not allow any non-free software
My laptop Librem 13 V3

I installed snap and many snap apps
the snap slack app works well

I am trying to work with lxd

here’s what the terminal shows:

sherab@Sherab-PureOS:~$ snap run slack
sherab@Sherab-PureOS:~$ snap run lxd
Error: This must be run as root
sherab@Sherab-PureOS:~$ sudo su
[sudo] password for sherab: 
root@Sherab-PureOS:/home/sherab# snap run lxd
EROR[04-22|12:10:10] Failed to start the daemon: LXD is already running 
Error: LXD is already running
root@Sherab-PureOS:/home/sherab# lxd init
bash: lxd: command not found

It shows that lxd is already running

but when I try to lxd init it says command not found.

Am I doing something wrong?
cheers


#2

what is the output of echo $PATH, both as your user and as root (under sudo su as above)?


#3

@chipaca

 root@Sherab-PureOS:/snap/bin# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin



sherab@Sherab-PureOS:~$ echo $PATH
/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin:/snap/bin:/var/lib/snapd/snap/bin

note this one please: here I am root and in the /snap/bin/
I try to run zenkit
below is the output

root@Sherab-PureOS:/snap/bin# /snap/bin/zenkit
ln: failed to create symbolic link '/root/snap/zenkit/2/snap/zenkit/2/Documents': No such file or directory
ln: failed to create symbolic link '/root/snap/zenkit/2/snap/zenkit/2/Desktop': No such file or directory
ln: failed to create symbolic link '/root/snap/zenkit/2/snap/zenkit/2/Downloads': No such file or directory
ln: failed to create symbolic link '/root/snap/zenkit/2/snap/zenkit/2/Music': No such file or directory
ln: failed to create symbolic link '/root/snap/zenkit/2/snap/zenkit/2/Pictures': No such file or directory
ln: failed to create symbolic link '/root/snap/zenkit/2/snap/zenkit/2/Videos': No such file or directory
ln: failed to create symbolic link '/root/snap/zenkit/2/snap/zenkit/2/Templates': No such file or directory

simliarly I get output for telegram-desktop:

root@Sherab-PureOS:/snap/bin# /snap/bin/telegram-desktop 
No protocol specified
QXcbConnection: Could not connect to display :0
Telegram[0xbe26d1]
Telegram[0xbe2c0c]
Telegram(_ZN15google_breakpad16ExceptionHandler12GenerateDumpEPNS0_12CrashContextE+0x382)[0x1a974dc]
Telegram(_ZN15google_breakpad16ExceptionHandler12HandleSignalEiP9siginfo_tPv+0x1c3)[0x1a970b7]
Telegram(_ZN15google_breakpad16ExceptionHandler13SignalHandlerEiP9siginfo_tPv+0x1ab)[0x1a96dcf]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7fbe5c8e7390]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7fbe5c022428]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7fbe5c02402a]
Telegram[0x27f93f7]
Telegram(_ZN14QXcbConnectionC2EP19QXcbNativeInterfacebjPKc+0xe93)[0x1ec9a63]
Telegram(_ZN15QXcbIntegrationC1ERK11QStringListRiPPc+0x2ea)[0x1e9e9fa]
Telegram[0x1e9d5cb]
Telegram[0x26c00dd]
Telegram[0x23ddddd]
Telegram[0x23dea35]
Telegram[0x29cc0f5]
Telegram[0x23e000f]
Telegram[0x209d959]
Telegram(_ZN4Core7SandboxC1EN3gsl8not_nullIPNS_8LauncherEEERiPPc+0x22)[0xc167a2]
Telegram(_ZN4Core8Launcher18executeApplicationEv+0x3d)[0xc16f2d]
Telegram(_ZN4Core8Launcher4execEv+0x4d)[0xc170ed]
Telegram(main+0x32)[0x9c0dc2]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fbe5c00d830]
Telegram(_start+0x29)[0x9cf249]
Aborted

finally what i find confusing is that this:

sherab@Sherab-PureOS:~$ snap run slack

makes slack run and functioning perfectly