yay
yay copied to clipboard
Upgrading yay failing with go build permission error
Affected Version
installed version: yay v11.0.1 - libalpm v13.0.1
trying to install: yay-11.0.2
Describe the bug
Installation of yay-11.0.2
with sudo yay -Syu
fails.
Spezifically:
go build -trimpath -mod=readonly -modcacherw -ldflags '-X "main.yayVersion=11.0.2" -X "main.localePath=/usr/share/locale/" -linkmode=external' -buildmode=pie -o yay
fails with
failed to initialize build cache at /root/.cache/go-build: mkdir /root/.cache: permission denied
Encountered similar error when updating yay-git
(1 aur/yay-git 11.0.1.r0.g52efaeb-1 -> 11.0.2.r0.g3fef4ae-1
), even with sudo privileges. When upgrading my yay packages: sudo yay -Syu
Switched to a new branch 'makepkg'
==> Starting pkgver()...
==> Updated version: yay-git 11.0.2.r30.gc0507e7-1
==> Sources are ready.
==> Making package: yay-git 11.0.2.r30.gc0507e7-1 (Wed 08 Dec 2021 10:48:41 AM CET)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting pkgver()...
==> Removing existing $pkgdir/ directory...
==> Starting build()...
go build -trimpath -mod=readonly -modcacherw -ldflags '-X "main.yayVersion=11.0.2.r30.gc0507e7" -X "main.localePath=/usr/share/locale/" -linkmode=external' -buildmode=pie -o yay
go: downloading github.com/Jguer/aur v1.0.0
go: downloading github.com/Jguer/go-alpm/v2 v2.0.6
go: downloading github.com/Morganamilo/go-pacmanconf v0.0.0-20210502114700-cff030e927a5
go: downloading github.com/Morganamilo/go-srcinfo v1.0.0
go: downloading github.com/leonelquinteros/gotext v1.5.0
go: downloading golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
go: downloading github.com/pkg/errors v0.9.1
go: downloading golang.org/x/sys v0.0.0-20211204120058-94396e421777
go: downloading golang.org/x/text v0.3.7
failed to initialize build cache at /root/.cache/go-build: mkdir /root/.cache: permission denied
make: *** [Makefile:111: yay] Error 1
==> ERROR: A failure occurred in build().
Aborting...
-> error making: yay-git
I can understand why this could happen with using sudo
, should be easy to reproduce and fix
is this issue still persistent? or has it been fixed?
It should be fixed