end-4 / dots-hyprland

i hate minimalism so...
https://end-4.github.io/dots-hyprland-wiki/en/
GNU General Public License v3.0
4.52k stars 315 forks source link

[Issue] Install (+update) script warning and prompting for password on every single metapackage install #823

Open b4shful opened 2 months ago

b4shful commented 2 months ago

The issue

I ran the install script to update stuff today, and I'm being prompted for a password for every single metapackage, like:

==> WARNING: A package has already been built, installing existing package...
==> Installing package illogical-impulse-audio with pacman -U...
[sudo] password for joel: 

I'm not sure if it's something I did or not. I did recently edit my /etc/makepkg.conf to set BUILDDIR=/tmp/makepkg as per https://wiki.archlinux.org/title/Makepkg#Building_from_files_in_memory

Not entirely sure if that affects anything. A full log of one metapackage install is below, but the warning and password prompt are repeated for every single one.

Logs ``` [./install.sh]: Next command: install-local-pkgbuild ./arch-packages/illogical-impulse-audio --needed Execute? y = Yes e = Exit now s = Skip this command (NOT recommended - your setup might not work correctly) yesforall = Yes and don't ask again; NOT recommended unless you really sure ====> y OK, executing... ~/.cache/dots-hyprland/arch-packages/illogical-impulse-audio ~/.cache/dots-hyprland [./install.sh]: Command "pushd ./arch-packages/illogical-impulse-audio" finished. Sync Dependency (5): swww-0.9.5-2, pavucontrol-1:6.1-1, wireplumber-0.5.6-1, libdbusmenu-gtk3-16.04.0.r498-2, playerctl-2.4.1-4 warning: playerctl-2.4.1-4 is up to date -- skipping warning: swww-0.9.5-2 is up to date -- skipping warning: pavucontrol-1:6.1-1 is up to date -- skipping warning: wireplumber-0.5.6-1 is up to date -- skipping warning: libdbusmenu-gtk3-16.04.0.r498-2 is up to date -- skipping there is nothing to do [./install.sh]: Command "yay -S --needed --asdeps pavucontrol wireplumber libdbusmenu-gtk3 playerctl swww" finished. ==> WARNING: A package has already been built, installing existing package... ==> Installing package illogical-impulse-audio with pacman -U... [sudo] password for joel: ```
b4shful commented 2 months ago

Maybe relevant? https://archlinux.org/news/manual-intervention-for-pacman-700-and-local-repositories-required/

I am unfamiliar with local repositories and such, so once again I must say I am... unsure

b4shful commented 1 month ago

Someone else reporting the same issue - and I notice I forgot to add here that I had also updated to pacman 7.0

Which makes it seem more likely that it wasn't related to my BUILDDIR change, but potentially related to changes surrounding pacman 7

Wafflewithketchup commented 1 month ago

My issue (#853) seems identical. Removing the directory and reinstalling from the network setup does not resolve it. Figured it might have been initialised with the wrong user premissions since it was created before pacman 7.0

Delta0001 commented 3 weeks ago

Experienced the same. Would love to not repeat my same password 20 times. Otherwise not critical.

b4shful commented 3 weeks ago

If someone has any free time, you could try seeing if the fix outlined here (https://archlinux.org/news/manual-intervention-for-pacman-700-and-local-repositories-required/) is relevant to this issue. I don't know how the metapackages work, so I can't even tell if this is relevant, but if it fixes it then I guess it was?

Wafflewithketchup commented 3 weeks ago

I've tried changing the ownership of the ~/EndDots-hyprland/arch-packages/ to alpm, but that didn't help any.

b4shful commented 3 weeks ago

Yeah, I tried that too, I have no idea what's going on. @end-4 any ideas? (also @clsty , although not sure if they are currently active or not)

clsty commented 3 weeks ago

So, the problem here is that pacman is executed under sudo which requires password.

The complete solution, I think, is to require password once before the whole script to temporarily store it, and enter the password for every sudo automatically. But this might be dangerous if not handled well enough, also I don't have experience on that thing, nor do I have time and energy to try. See https://stackoverflow.com/a/36603412 and https://bbs.archlinux.org/viewtopic.php?id=249369 if someone is interested.

Here is a workaround (sacrifice security in exchange for convenience): just configure sudo to not require any password for the command. I guess the following should work (NOT TESTED, maybe remove -U or add ,/usr/bin/makepkg if not work): Run visudo (which basically edits /etc/sudoers but safer) and add the following (assuming your user is in the group wheel):

%wheel ALL=(ALL) NOPASSWD: /usr/bin/pacman -U

See https://wiki.archlinux.org/title/Sudo#Example_entries for more.

b4shful commented 2 weeks ago

@clsty The strange thing is, it was working previously. Makes me wonder, what has actually changed to cause this to no longer work the way it used to?

clsty commented 2 weeks ago

@clsty The strange thing is, it was working previously. Makes me wonder, what has actually changed to cause this to no longer work the way it used to?

I don't know. I guess that it's because sudo asks your password only once during a specific length of time, and ask again after that period, and for some reason this period was exceeded for some sudo during execution of the script.

Wafflewithketchup commented 2 weeks ago

No, it's not to do with time, my timeout is 5 minutes, and the install script will ask the pw twice in 10 seconds

On Sun, 3 Nov 2024, 08:39 Celestial.y, @.***> wrote:

@clsty https://github.com/clsty The strange thing is, it was working previously. Makes me wonder, what has actually changed to cause this to no longer work the way it used to?

I don't know. I guess that it's because sudo asks your password only once during a specific length of time, and ask again after that period, and for some reason this period was exceeded for some sudo during execution of the script.

— Reply to this email directly, view it on GitHub https://github.com/end-4/dots-hyprland/issues/823#issuecomment-2453329642, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQYIMBOAJAOBS6L326DSVKLZ6XHLLAVCNFSM6AAAAABOQOHFZWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJTGMZDSNRUGI . You are receiving this because you are subscribed to this thread.Message ID: @.***>