Yay gives permission error when trying to update AUR package

I’m trying to update the vscodium package off the AUR using yay.
When I do yay -Syu, it does find the packges, but cannot build it:

:: Searching databases for updates...
:: Searching AUR for updates...
:: 1 Packages to upgrade.
1  aur/vscodium-bin  1.63.2-2 -> 1.64.0-1
==> Packages to exclude: (eg: "1 2 3", "1-3", "^4" or repo name)
==>
:: Checking for conflicts...
:: Checking for inner conflicts...
[Aur:1]  vscodium-bin-1.64.0-1

:: (0/1) Downloaded PKGBUILD: vscodium-bin
 -> error fetching vscodium-bin: fatal: could not create work tree dir 'vscodium-bin': Permission denied
	 context: exit status 128

I have tried chowning everything in ~/.cache/yay/ but that didn’t work. Am I missing something?

Try deleting the yay cache (delete the directory ~/.cache/yay/vscodium-bin) and remove the package (with sudo pacman -R vscodium-bin). Then install it again.

You may want to back up the package first (the latest .pkg.tar.zst file in ~/.cache/yay/vscodium-bin), in case you cannot reinstall it.

3 Likes

That worked! Thank you.
It was most likely because I was running yay as sudo. The message warning against it would be lost in the lines of scrolling text. I just noticed it when trying to install the package again.
Muscle memory sucks, but I hope this will help someone else later

2 Likes

Yeah, never run yay with sudo:

There is even a meme about it:

4 Likes

Trust me, i’ll always remember now :slight_smile:

2 Likes

Oh no, you let @Kresimir into your brain. In fact, is he there in the room with you now?

Pudge

3 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.