fosskers / aura

A multilingual package manager for Arch Linux and the AUR.
https://fosskers.github.io/aura/
GNU General Public License v3.0
1.74k stars 113 forks source link

Support building as `root` for systems with no other user #776

Closed ghost closed 2 months ago

ghost commented 2 years ago

I can still able to install AUR packages manually under root...

git clone <repo>
chown -R nobody <package-dir>
cd <package-dir>
sudo -u nobody makepkg
pacman -U *.zst

Note: On missing dependencies, I could able to fix that by installing missing dependencies pacman -S --asdeps <missing-dep-list> And then trying makepkg process again with success.

This method will overcome makepkg root limitations. And I would love to see this incorporating into aura.

fosskers commented 2 years ago

Aura 4 no longer has limitations involving root, so this should be an auto-fix as soon as it's released.

ghost commented 2 years ago

So... Is there any reason you're holding up 4.0 release mate?

fosskers commented 2 years ago

Because I moved across the world and just started a new job. It will come as soon as I'm able.

ghost commented 2 years ago

Because I moved across the world and just started a new job. It will come as soon as I'm able.

Amazing. Offtopic, but congrats. Hope you enjoy your new job mate.

fosskers commented 2 years ago

Thanks for your patience :pray: Getting this out as soon as possible is obvious still big in my mind.

fosskers commented 2 years ago

Give it a shot!

cargo install aura-pm --version 4.0.0-alpha3
ghost commented 2 years ago
#[/home/mpk/.cargo/bin]# ./aura -A extension-manager
aura :: Resolving dependencies...
aura :: AUR packages:
 extension-manager
aura :: Proceed? [Y/n] 
aura :: Preparing build directories...
aura :: Building extension-manager...
==> ERROR: Running makepkg as root is not allowed as it can cause permanent,
catastrophic damage to your system.
aura :: Package failed to build, citing:

  makepkg failed.

aura :: Action cancelled.

Works fine outside root btw. But it still has recurring missing dependency installation issue. I still had to install missing deps myself.

(1/1) Arming ConditionNeedsUpdate...
aura :: Preparing build directories...
aura :: Building extension-manager...
==> Making package: extension-manager 0.3.2-2 (Sat 24 Sep 2022 01:18:03 AM)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Missing dependencies:
  -> appstream-glib
==> ERROR: Could not resolve all dependencies.
aura :: Package failed to build, citing:

  makepkg failed.

aura :: Continue building other packages? [Y/n] 
aura :: Done.
$[~/.cargo/bin]$
fosskers commented 2 years ago

Yup, -A is not expected to be ran with root.

ghost commented 2 years ago

Yup, -A is not expected to be ran with root.

You can actually de-elivate privilege escalations through -u nobody. It should then work as it is not on root.

fosskers commented 2 years ago

I still need to as some "true" root detection in general.

ghost commented 2 years ago

I still need to as some "true" root detection in general.

Welp, for pushing compiled binaries or shared libraries, ofc I can understand. But to compile from source via AUR pkgbuilds, programs like makepkg won't function, is what I'm saying. Atleast they need de-escalation of privilege.

fosskers commented 2 years ago

You mean when managing a system with only a root user on it, yeah?

ghost commented 2 years ago

You mean when managing a system with only a root user on it, yeah?

Yep. My ultimate scenario / goal is to build & install AUR packages even on chrooted Arch ISO. pacstrap can install from pac repos. So why not an AUR wrapper can...✌️ Currently, I can do that manually (1st comment) & it works, but can't automate it for multiple AUR packages, unless I maintain a script.

fosskers commented 2 years ago

Understood, I'll make sure this is possible.

fosskers commented 2 months ago

It is now possible to build packages as root using nobody as a proxy.