Cannot start hello-world snap: mkdir: cannot create directory '/home/martin/snap/hello-world': Permission denied -- don't create $HOME/snaps as root
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
I am currently following the tutorial at http://
$ sudo apt install -y snapd
$ sudo snap install hello-world
74.08 MB / 74.28 MB [======
hello-world (stable) 6.3 from 'canonical' installed
$ LC_ALL=C /snap/bin/
mkdir: cannot create directory '/home/
strace shows:
[pid 14728] chdir("martin") = 0
[pid 14728] mkdir("snap", 0777) = -1 EEXIST (File exists)
[pid 14728] chdir("snap") = 0
[pid 14728] mkdir("
[pid 14728] chdir("
Indeed I have an already existing root-owned ~/snap directory, as I was asked a few days to install the ubuntu-device-flash beta snap. That program needs to run as root and was the first-ever snap that I installed.
I suggest to never create ~/snap with root privileges to avoid that, and also to avoid breaking backups etc.
ProblemType: Bug
DistroRelease: Ubuntu 16.10
Package: snapd 2.13+16.10
ProcVersionSign
Uname: Linux 4.4.0-9136-generic x86_64
ApportVersion: 2.20.3-0ubuntu7
Architecture: amd64
CurrentDesktop: i3
Date: Mon Aug 29 22:07:30 2016
EcryptfsInUse: Yes
SourcePackage: snapd
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in snapd (Ubuntu): | |
status: | New → Triaged |
This was a bug in snap-confine/ snap-run that is fixed now. I verified that it is no longer reproducible.