Yay wont update or reinstall a mullvad-vpn

My other packages from AUR upgraded fine so not an issue with yay or AUR overall.

When trying my usual upgrade with no clean builds on any packages I got dozens and dozens of errors of being unable to delete files like this.

rm: cannot remove '/home/me/.cache/yay/mullvad-vpn/src/gopath/pkg/mod/golang.org/x/tools@v0.0.0-20180917221912-90fa682c2a6e/playground/socket/socket.go': Permission denied
rm: cannot remove '/home/me/.cache/yay/mullvad-vpn/src/gopath/pkg/mod/golang.org/x/tools@v0.0.0-20180917221912-90fa682c2a6e/playground/local.go': Permission denied
rm: cannot remove '/home/me/.cache/yay/mullvad-vpn/src/gopath/pkg/mod/golang.org/x/tools@v0.0.0-20180917221912-90fa682c2a6e/playground/appengine.go': Permission denied

I checked the AUR page for the package and although no posts of similar errors there is a post at top saying to always do a clean build in capital letters.

Running with clean build I get this.

$ yay -Syu

...

:: 1 Packages to upgrade.
1  aur/mullvad-vpn  2022.2-2 -> 2022.4-1
==> Packages to exclude: (eg: "1 2 3", "1-3", "^4" or repo name)
==> 
:: Checking for conflicts...
:: Checking for inner conflicts...
[Aur:1]  mullvad-vpn-2022.4-1

  1 mullvad-vpn                      (Installed) (Build Files Exist)
==> Packages to cleanBuild?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> a
:: Deleting (1/1): /home/me/.cache/yay/mullvad-vpn
unlinkat /home/me/.cache/yay/mullvad-vpn/src/gopath/pkg/mod/github.com/lxn/win@v0.0.0-20210218163916-a377121e959e/edit.go: permission denied
:: (0/1) Downloaded PKGBUILD: mullvad-vpn
 -> error fetching mullvad-vpn: fatal: destination path 'mullvad-vpn' already exists and is not an empty directory. 
	 context: exit status 128

I thought I’d try removing it with yay -R mullvad-vpn and reinstall but i get

  1 mullvad-vpn                      (Build Files Exist)
==> Packages to cleanBuild?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> 
:: (0/1) Downloaded PKGBUILD: mullvad-vpn
 -> error fetching mullvad-vpn: fatal: destination path 'mullvad-vpn' already exists and is not an empty directory. 
	 context: exit status 128

Should I just forcefully delete the #/.cache/yay/mullvad-vpn directory and try again? Or other suggestions of what’s not working? Seems weird the directory should have odd permissions.

I think it’s safe to do so. But instead, rather make a backup of the cache you can delete if all goes according to plan:

mv ~/.cache/yay ~/.cache/yay.backup

If all goes well, then remove that directory:

rm -r ~/.cache/yay.backup

There was only the src folder left there after my removing it with yay -R so I just moved that to a safe place and tried the install again. Just finished successfully.

Would still be good to know what went wrong as it seems all those files had normal privileges so it shouldn’t have been erroring in the first place…

1 Like

To me it sounds like you at one point had used sudo yay instead of just yay to install/update mullvad.
But it’s guessing.

1 Like

It would, yeth.

But I think to find out would involve quite a bit of digging, which, to me at least, means it’s probable not for us mere mortals to know…

More specifically, the GOPATH (/src/go-path/) folder:

sudo rm -rf /home/me/.cache/yay/mullvad-vpn/src/gopath/

It’s a known issue. That’s why go clean -modcache is run after build. However, if the build fails before that, the issue you had will occur.

2 Likes