Arch-Linux

Arch linux WSL AUR

  • February 17, 2022

如何讓 AUR 建構在 WSL 中工作。

本質上我總是得到 Permission denied (os error 13) 因為我沒有以 root 身份執行

但是您不能將 AUR 用作 root 使用者,因此請注意 22。

顯示為根和本地的範例事務

   [root@DannysLaptop ~]# paru -S system-monitoring-center
:: Resolving dependencies...
error: can't install AUR package as root
[root@DannysLaptop ~]# su danny
[danny@DannysLaptop root]$ paru -S system-monitoring-center
:: Resolving dependencies...
:: Calculating conflicts...
:: Calculating inner conflicts...

Repo (8) dmidecode-3.3-1  startup-notification-0.12-7  libxres-1.2.1-1  libwnck3-40.0-1  mesa-utils-8.4.0-7  python-cairo-1.20.1-3  freeglut-3.2.2-1  python-opengl-3.1.5-6
Aur (1) system-monitoring-center-1.2.1-1

:: Proceed to review? [Y/n]: 

:: Downloading PKGBUILDs...
PKGBUILDs up to date
nothing new to review
error: failed to run: sudo pacman --sync -- extra/dmidecode extra/startup-notification extra/libxres extra/libwnck3 extra/mesa-utils extra/python-cairo extra/freeglut extra/python-opengl: Permission denied (os error 13)
[danny@DannysLaptop root]$ 

感謝 NotTheDr01ds 指出這是一個基於 Rust 的錯誤。切換到yay(基於 Go 而不是 Rust)為我避開了這個問題,並且執行良好。

您看到的錯誤似乎與 Rust 的某種權限問題有關。有關一些可能的見解,請參閱此 Github 問題。請注意,paru在嘗試複製您的問題時,我自己能夠在 WSL2 下的 Arch 上安裝和執行沒有問題。

您的 WSL2/Arch 主目錄中是否有任何異常?/home/danny/.cargo例如,如果在 Windows 驅動器上,我可能會看到這種情況。/home/danny/.cargo或者是否有任何文件或目錄/home/danny/.rustup屬於root?

引用自:https://unix.stackexchange.com/questions/690124