Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

10
  • What OS are you using? Do you have sudo set up? Commented Sep 17, 2015 at 22:32
  • I'm running this on Arch Linux and sudo is set up. I'd like to possibly share this script down the road, so I'd like to keep as generic as possible. I edited the op to reflect this. Commented Sep 18, 2015 at 2:30
  • Why does building a list of packages requires to be user not root? Are you on NFS? Commented Sep 18, 2015 at 6:00
  • This is an Arch Linux relate standard, to not build packages as root. In fact makepkg will not run as root. Arch has the AUR, Arch user repository. This repo contains build scripts rather than binary pre built packages. Anyone can contribute, mostly unchecked, so the potential is there for things to go wrong, either in error or malicious. More info: allanmcrae.com/2015/01/replacing-makepkg-asroot Commented Sep 18, 2015 at 8:46
  • 1
    It's very hard to understand what you're doing since you don't show your scripts. Could you simplify this to an example script that reproduces the problem? If you need to run a single command as non-root, just use sudo -u user command or su -c command user. Commented Sep 18, 2015 at 11:53