You are not logged in.
So I'm trying to make an Arch installation script. It works perfectly fine up to a point where I install some user applications. To do this, I install paru (the AUR helper) and then feed paru an array of packages that it should install.
There's a problem tho. All of this is being done in the chroot as the root user, and you can't build AUR packages as root, you need to be a regular user with root privileges. So, I instead run this command:
sudo -u ${USR} paru --needed --noconfirm -S ${APPS[@]}
Where USR is the username and APPS is the array of packages I want to install. This seems to work fine, but it fails because of a permission error, and I don't really understand why.
When I create the user, I give it sudo rights by editing the sudoers file with sed, and it works fine. It seems intuitive to think that the problem here is caused because sudo is expecting a password and it's not being given one, but I actually allow the user to use sudo without a password previous to running this command, and then revert those changes. Plus, the error I get is not the one I'd get if sudo doesn't get a password.
This:
https://i.imgur.com/ik7bReT.png
is how sudo errors out if no password is given, but this:
https://i.imgur.com/fhNp8jW.png
is the error I'm getting. I don't really understand why. Can I get a hand?
Here's the line that's causing the error in the script in case somebody wants to inspect it further. Thanks.
Mod Edit - Please read the forum rules.
CoC - Pasting pictures and code
Last edited by Slithery (2021-12-19 19:23:44)
Offline
Did you add the user to the wheel group?
Offline
It is already in the wheel group. Actually, apart from this, the whole installation completes without issues and the system works as expected. You can see here all the groups the user belongs to. Some may not be needed but anyway, wheel is there.
Last edited by tralph3 (2021-12-20 07:08:26)
Offline