13

My PC fails to run snap packages, when I try I get:

2021/07/31 20:56:38.255535 cmd_run.go:576: WARNING: XAUTHORITY environment value is not a clean path: "/mnt/e664d184-8567-4278-93ce-c986567c66af/home/iaquobe/.Xauthority" cannot create user data directory: /home/iaquobe/snap/shapezio/2: Not a directory 

The directories do however exist. So far the packages I tested are 0ad shapezio whatsdesk, all of them had the same issue.

Those packages do run on my laptop. One thing that is different is that on my PC /home/iaquobe is a symbolic link to a drive at /mnt/[...]/home.

This is the only cause for this error I could think of, what do you think? And what could I do to fix it?

Thanks in advance :)

3 Answers 3

14

The /home symlink is indeed causing the issue. This is a known snap bug (or to be more precise design limitation of snap) -- with snap packages home can't be a symlink or a different directory than /home, see this bug for details. Suggested workaround/fix is to run sudo dpkg-reconfigure apparmor but some people in the bug discussion said it didn't help so it might not work.

0
7

We use domain with realm, so our path home is not /home, instead /home/MYDOMAINCOMPANY/. I fixed by editing /etc/apparmor.d/tunables/home.d/ubuntu with that line:

@{HOMEDIRS}+=/home/MYDOMAINCOMPANY/ 

After save, just restart some services:

systemctl restart apparmor.service snapd.apparmor.service snapd.service snapd.socket 

That way I can run at many computers by script or using Ansible.

1
  • It is also possible to list multiple directories: @{HOMEDIRS}+=/home/MYDOMAINCOMPANY/ /home/ Commented Jun 27, 2023 at 12:36
2

I had the same issue using a symlink for my home directory. Fixed it by removing the symlink and mounting the new home directory location in /etc/fstab by adding:

/media/my-other-drive/home/myuser /home/myuser none bind 0 0 

Then mount the home dir:

sudo mount -a 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.