I use Kali Linux for my pentesting needs. I installed snap to get some of my needs like Tusk (Evernote for Linux).
I installed via apt install snapd and ran sudo systemctl enable --now snapd.socket to get snap working. Then I ran snap install tusk which installed fine. It did warn me my $PATH was not there etc and I should restart, which I did.
After restarting I tried starting Tusk but it wouldn’t start. As a result, I tried to start it via terminal by writing snap run Tusk to which I got this:
cannot change profile for the next exec call: No such file or directory
snap-update-ns failed with code 1: File exists
Now I did find a thread regarding this and found running apparmor_parser -r /var/lib/snapd/apparmor/profiles/* fixes this but I have to run this everytime I restart my laptop. Is there a permanent fix for this?
Kali linux is not on the set of distributions we regularly test so some things may misbehave. In this specific case I think the snapd.apparmor.service is required to load snapd-specific apparmor profiles on boot.
I’m not familiar with Kali linux so I don’t know if it is derived from another distribution or what kind of file system flavour it uses. I would first start by looking at this list of topics:
check if snapd needs to blacklist kali for re-execution
check if snap-confine is configured and built correctly
check if all snapd systemd units are loaded
this last part is tricky because some units are only needed on “core” systems that don’t use classic packages and where snapd manages the entire operating system
I ran now into the same issue with Ubuntu 18.04, when running Graylog (via juju) on LXD containers (manually provisioned).
The problem appeared after a VM reboot.
Good thing is that " apparmor_parser -r /var/lib/snapd/apparmor/profiles/*" fixed the problem.
I’m having the very same issue but on Arch Linux. apparmor_parser -r /var/lib/snapd/apparmor/profiles/* fixes the issue but I have to use it every time I reboot.
Hi, I just wanted to let you know that your last suggestion solved my problem. I am running snap Nextcloud on a Pinephone (normal) with Arch linux Arm phosh.
I could get Nextcloud snap up and running, but after first reboot would get the error message:
cannot change profile for the next exec call: No such file or directory snap-update-ns failed with code 1
Typing the following commands and rebooting seems to have solved the problem: