packer icon indicating copy to clipboard operation
packer copied to clipboard

--asroot is no longer an option

Open nshp opened this issue 9 years ago • 13 comments

As of Pacman 4.2, --asroot is no longer an option. makepkg must be run as a normal user. Perhaps packer should give its own error message when run as root?

nshp avatar Dec 21 '14 22:12 nshp

Yeah, if packer s for install packages from AUR and makepkg not support root user, then why packer support it?, yeah I aggre in a silly nbut informative message about not supporting root.

JotaRandom avatar Dec 22 '14 05:12 JotaRandom

This is also a problem that I am encountering.

nubzzz avatar Dec 29 '14 16:12 nubzzz

Yeah, it emerged to me after todays update. I can't finalize update with all dependencies in AUR

pawel-tomkiel avatar Dec 29 '14 17:12 pawel-tomkiel

+1, although running as a normal user works just fine.

f3rno avatar Dec 29 '14 19:12 f3rno

To get around this, just run packer as a normal (non-root) user.

See also: https://github.com/archlinuxfr/yaourt/issues/67

mgalgs avatar Dec 29 '14 22:12 mgalgs

Pull request #132 fixes this, would be good to get it in since many people must be experiencing this problem.

f3rno avatar Dec 30 '14 01:12 f3rno

what about

# diff -Naur /usr/bin/packer*
--- /usr/bin/packer     2014-08-11 10:43:24.000000000 +0200
+++ /usr/bin/packer.xmw 2015-01-01 23:39:05.706239397 +0100
@@ -328,7 +328,9 @@

   # Installation (makepkg and pacman)
   if [[ $UID -eq 0 ]]; then
-    makepkg $MAKEPKGOPTS --asroot -f
+    id pacman >/dev/null 2>/dev/null || useradd -r -d /var/empty pacman
+    chown -R pacman:pacman .
+    su -c "makepkg $MAKEPKGOPTS -f" pacman
   else
     makepkg $MAKEPKGOPTS -f
   fi

xmw avatar Jan 01 '15 22:01 xmw

@xmw golly, i wish github had a comment voting option. i'd vote your patch up so hard.

i'd love to see that implemented as well.

ghost avatar Jan 02 '15 07:01 ghost

EDIT: Added workaround to apacman wrapper @xmw Thank you for such an elegant fix! I was going to implement AUR user in the .install which is less optimal.

oshazard avatar Jan 02 '15 08:01 oshazard

+1 thanks @xmw

mil avatar Jan 16 '15 22:01 mil

+1 @xmw I've now migrated to using apacman instead since the developer implemented this patch.

simon-thorpe avatar Jan 29 '15 06:01 simon-thorpe

:+1:

despairblue avatar Apr 04 '15 11:04 despairblue

Thank you @xmw that fixed my update problems.

RaederDev avatar Apr 19 '15 20:04 RaederDev