I've used the snap package manager to install packages and I'm always getting the same error, even with the simple hello world example:

$ sudo snap install hello
$ hello
cannot create user data directory: /home/aaa/snap/hello/20: Bad file descriptor

Running with sudo solves the problem for the hello program, but why do I even need to do sudo?

BTW, for the other packages (Meshlab, CloudCompare) it doesn't work also with sudo and gives different errors. For example:

~$ sudo cloudcompare.ccViewer 
mkdir: cannot create directory '/run/user/0': Permission denied
No protocol specified
QXcbConnection: Could not connect to display :0

The snap version and Ubuntu distro are:

$ snap version
snap    2.22.7
snapd   2.22.7
series  16
ubuntu  14.04
kernel  4.4.0-64-generic
share|improve this question
    
Probably bad permissions to /home/aaa/snap/ or rest of them... if you run it firstly with root, then root created those files... and normal user cant write there. – Flash Thunder Mar 5 '17 at 11:43
    
@FlashThunder But I cannot install without sudo, similar to sudo apt-get .... I also checked and I have full premissions for /home/aaa/snap/. – Elad Joseph Mar 5 '17 at 11:48
    
@Flash if this were permission-related I would expect to see that reflected in the error (e.g. permission denied). – Kyle Mar 5 '17 at 15:57
    
Can you add some detail about what distro you're running this on? Also, the output of "snap version" would be helpful. – popey Mar 5 '17 at 16:10

Any chance your home directory is an nfs share with no-write-by-root enabled? If so, try logging in as another user that has a local home.

Also, see: https://bugs.launchpad.net/snappy/+bug/1625279

share|improve this answer
    
Please edit to add a summary of that bug's relevance to this question so others don't have to visit it to figure anything out. – Nathan Tuggy Apr 21 '17 at 2:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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