TL;DR I had moved my /root directory onto the /home partition to ensure its contents are respected (too) between reinstalls. Snap notices stuff like that and won’t go along with it.
$ sudo snap install gimp
error: cannot perform the following tasks:
Run install hook of “gimp” snap if present (run hook “install”: cannot perform operation: mount --rbind /root /tmp/snap.rootfs_XOSjpI//root: Permission denied)
I, as root, would like to know just what process thinks “it” can deny(?), Me, permission(?) to, well, anything, anywhere on My machine. (So I can kill it. A lot. And then pour salt on it.)
Other than that, I’m completely over it and could use some advice how to proceed.
This looks like it might be a snapd issue. @zyga-snapd have you seen this before? It looks like snapd is unable to implement the complete mount namespace before running the hooks. (the GIMP install hook does not call mount, so the error is not actually coming from the hook itself).
@DavidOertl, would it be possible for you to post the output of running the following command in a terminal, please?
# snap version
snap 2.44.1
snapd 2.44.1
series 16
ubuntu 18.04
kernel 5.3.0-46-generic
# apt install snap
snapd is already the newest version (2.42.1+18.04).
[Incidentally that must be some kind of Olympic record for response time… ;^) ]
“But it’s a new thing. I just started doing that with this install. And I did it for a Very Good Reason: I noticed that when I re-installed just days ago that although I had taken steps to preserve all my user accounts info by having a separate “/home” partition, the “/root” directory was trashed, and I lost very important how-to notes I had saved there, of interest to user root.”
Famous Last Words:
“There, I fixed it.”
Good eye.
But having said that, “I sure would like to keep it /root, the pointer to /home/root.” but will happily accept why I may not.
To keep your /root files in /home/root you can add this to /etc/fstab:
/home/root /root bind defaults 0 0
That will bind-mount the /home/root dir to /root so you can keep using /root as the root user’s home directory but the files will actually be saved to /home/root. This is better (for snaps) than a symlink because the files are actually exposed as though they were really in /root so apparmor doesn’t complain. Apparmor cannot follow symlinks, but bind mounts are good as a workaround for the same concept.