3

Since (most likely - because it worked on 18.10 last time I intentionally checked) updating to Ubuntu 19.04 I cannot get snap to work. Some of my software was updated automatically via snap, but it doesn't any longer.

Whenever I try to run update a software in the Ubuntu Software it prompts the error message

error: system does not fully support snapd: cannot mount squashfs image using "squashfs": exec:
    "mount": executable file not found in $PATH

Same message pops up when I run snap refresh in the command line. I tried to add /snap/bin to the path, but to no avail.

For further information: I'm running a oh-my-zsh terminal and the path is currently configured in /etc/environment.

Edit: Re-installing snapd:

apt install snapd
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
gyp javascript-common libjs-inherits libjs-is-typedarray libnode-dev libssl-dev libuv1-dev
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
snapd
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 13,4 MB of archives.
After this operation, 65,5 MB of additional disk space will be used.
Get:1 http://at.archive.ubuntu.com/ubuntu disco/main amd64 snapd amd64 2.38+19.04 [13,4 MB]
Fetched 13,4 MB in 0s (47,1 MB/s)
Selecting previously unselected package snapd.
(Reading database ... 175145 files and directories currently installed.)
Preparing to unpack .../snapd_2.38+19.04_amd64.deb ...
Unpacking snapd (2.38+19.04) ...
Setting up snapd (2.38+19.04) ...
md5sum: /etc/apparmor.d/usr.lib.snapd.snap-confine: No such file or directory
snapd.failure.service is a disabled or a static unit, not starting it.
snapd.snap-repair.service is a disabled or a static unit, not starting it.
Processing triggers for desktop-file-utils (0.23-4ubuntu1) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for gnome-menus (3.32.0-1ubuntu1) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for bamfdaemon (0.5.3+18.04.20180207.2-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...

I suppose this No such file or directory messages aren't exactly helping in my case.

  • 1
    Try reinstalling the snapd package (using apt). If it fails, please copy-and-paste the entire output into your question. – user535733 May 15 '19 at 12:15
  • @user535733 Thanks, I've tried re-installing snapd, see edit - hasn't changed anything so far. :) – LordAnomander May 15 '19 at 12:54
  • The no such file or directory message seems irrelevant. That file is not on my 19.04 test system either, yet snap works properly. – user535733 May 15 '19 at 13:15
3

TLDR; To fix, create /etc/environment.d/, set the path in a configuration file there, and reboot:

sudo mkdir /etc/environment.d
sudo echo -e "PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/snap/bin"\nXDG_DATA_DIRS="/usr/local/share:/usr/share:/var/lib/snapd/desktop"" > /etc/environment.d/60-snap-icons-and-bin.conf
sudo reboot now 

I had the same problem on Ubuntu 18.04.02 LTS aka bionic, kernel 4.15.0-50. My snap was working but I couldn't look at logs, switch channels, save snapshots, or manage services:

error: system does not fully support snapd: cannot mount squashfs image using "squashfs": exec:
   "mount": executable file not found in $PATH

Turned out the problem has nothing to do with squashfs; I eventually found evidence it had to be an environment problem:

error: cannot get logs: exec: "journalctl": executable file not found in $PATH

The squashfs mounts are present:

/var/lib/snapd/snaps/core_0000.snap on /snap/core/0000 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/nextcloud_11111.snap on /snap/nextcloud/11111 type squashfs (ro,nodev,relatime,x-gdu.hide)

I had set /etc/environment this way:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap:/snap/bin"

Couldn't see how that wouldn't be working, so I ruled out problems with seccomp or apparmor, modules, missing packages, or snap configuration files.


When I'd almost concluded that I was one of two people in the world having this problem, I hit upon an old post about snap desktop apps; I modified the solution to fit. Probably there are other ways to make the environment work - see environment.d manual. The system sources environment variables from very different files depending on what kind of shell you're in, or if you're in one at all.

sudo mkdir /etc/environment.d
sudo echo -e "PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/snap/bin"\nXDG_DATA_DIRS="/usr/local/share:/usr/share:/var/lib/snapd/desktop"" > /etc/environment.d/60-snap-icons-and-bin.conf
sudo reboot now
  • 1
    Thanks, I totally forgot about my question. This is the right answer - if snap stopped working there is something wrong with your path. In my case, I haven't set the paths correctly in /etc/environment and fixing them fixed snap. – LordAnomander Jun 3 '19 at 8:35
  • Thank you. After researching and trying several fixes this is the only one that actually solved it for me. In my case was with Hyper-V and both Ubuntu 18.04.2 LTS and also 19.04 – kerzek Aug 22 '19 at 23:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.