Score:0

Permission Denied Error when trying to install packages in a directory I have group permissions to

us flag

I have a Linux machine where my user (non-root) user is assigned the group user_group. I am using a special package manager called spack and would like to use it in a directory where only root users have write and execute permissions. I installed it there using sudo and then added those modifications to the directory itself:

sudo chgrp -R user_group spack/
sudo chmod -R +rwx spack/

Now I am able to use this package-manager to install some packages. for other packages however, it returns the following error:

...

==> Installing nasm-2.15.05-xfzo4rjbzpriugrjmr7ecszho4jowvku
==> No binary for nasm-2.15.05-xfzo4rjbzpriugrjmr7ecszho4jowvku found: installin                                                                                                                                                             g from source
==> Fetching https://mirror.spack.io/_source-cache/archive/3c/3caf6729c1073bf966                                                                                                                                                             29b57cee31eeb54f4f8129b01902c73428836550b30a3f.tar.xz
==> Error: PermissionError: [Errno 13] Permission denied: '/usr/local/etc/spack/                                                                                                                                                             var/spack/cache/_source-cache/archive/3c/3caf6729c1073bf96629b57cee31eeb54f4f812                                                                                                                                                             9b01902c73428836550b30a3f.tar.xz'

/usr/local/etc/spack/lib/spack/spack/package.py:1401, in do_fetch:
       1398
       1399        if checksum and self.version in self.versions:
       1400            self.stage.check()
  >>   1401
       1402        self.stage.cache_local()
       1403
       1404        for patch in self.spec.patches:

...

My guess is that this newly created folder does not yet have the permissions I have granted all the other already present files. Is there any way I can prevent this from happening? How can I still download and install packages in this situation?

dmmpie avatar
us flag
@steeldriver you are right, but this didn't change anything about the same error occuring.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.