`lxc` missing when installing custom lxd-snap


I am building lxd using snapcraft:

git clone https://github.com/lxc/lxd-pkg-snap.git --branch 4.0-candidate
cd lxd-pkg-snap && snapcraft --destructive-mode

The build runs fine, but when I install the resulting snap lxd_4.0.2_amd64.snap,
it does not install the lxc command, because a symlink in /snap/bin is missing:

/snap/bin/lxc -> lxd.lxc*

I can add the symlink manually and it works, but I wonder if this is the right


You can run snap alias lxd.lxc lxc to create the alias manually. The lxd snap from the store has an automatic alias that is declared in an assertion provided by the store.
However, the binary you have built is different and the assertion no longer applies to it, so you need to take a manual step to create an alias.

1 Like