To avoid confusion I want to add that yay itself should not be run as
root.
yay will prompt for a password once it needs elevated privileges.
pacman can be invoked safely with sudo.
On 2024-04-07 21:38, Aaron Liu wrote:
Ey,
yay is just a wrapper for pacman. If running pacman tells you that it
has a permission issue, you should run the commands as root, e.g. by
prefixing them with sudo. All pacman commands should also work on yay
as long as you replace "pacman" with "yay". Generally, in the Arch
wiki, all lines prefixed with # mean that you should run the command as
root.