Issues with permissions and yay & git: when yay uses git, I get permission error. same with python pip

Hi, installed manjaro linux wiht i3 a couple of days ago. I decided to use yay with the AUR packages, but I must have done something wrong. I can install:

yay -S intel-mkl

without problems. But if I want to install the lf filemanager:

yay -S lf

:: There are 3 providers available for lf:
:: Repository AUR
    1) lf 2) lf-bin 3) lf-git

Enter a number (default=1):
==> 1
:: Checking for conflicts...
:: Checking for inner conflicts...
[Aur:1]  lf-27-1

:: (0/1) Downloaded PKGBUILD: lf
 -> error fetching lf: Cloning into 'lf'...
fatal: Invalid path '/home/emil/.cache/yay/lf/.git': Permission denied
         context: exit status 128

This seems to be related to git. I tried looking at how file permissions work, my user seem to have ownership of the directories in .cache and yay.

This also happens when I try to use the python pip installer, I suspect it’s the same underlying issue:

 python -m ensurepip --default-pip
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.10/ensurepip/__main__.py", line 5, in <module>
    sys.exit(ensurepip._main())
  File "/usr/lib/python3.10/ensurepip/__init__.py", line 277, in _main
    return _bootstrap(
  File "/usr/lib/python3.10/ensurepip/__init__.py", line 177, in _bootstrap
    with open(filename, "wb") as fp:
PermissionError: [Errno 13] Permission denied: '/tmp/tmp0o78aygj/setuptools-58.1.0-py3-none-any.whl'

Interestingly, this did not happen when I installed manjaro on my other laptop two weeks ago. I think I used another guide for installing yay, I found both of them on the internet. I suspect it’s about the second guide using sudo a wrong place (or perhaps I inserted it by mistake)

Help much appreciated, tried googling somewhat extensively without succes.

Why would you need a guide from who-knows-where from the internet for installing a package that is in manjaro’s repos?

Oh god. so you mean I could just do:

sudo pacman -S yay

??
In that case, I think might just reinstall the OS again, start from clean slate.

Yup.

It should work just the same if you build it with github instructions though.

aight, Thanks. What to learn from this? Always find the most official source before rando blogposts of google :smiley:

Exactly. First manjaro, then archwiki, then linux in general and everything else, and then blog posts. :stuck_out_tongue:
And btw, it takes you 2 seconds to search if some package is in official repos.

1 Like