You are not logged in.
Pages: 1
Hello guys!
I am searching for a way to install some packages from the aur with a custom script (for the purpose of reinstalling arch linux).
I already wrote down some code which works fine ...
mkdir /tmp/PACKAGE && cd /tmp/PACKAGE
curl -L https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=PACKAGE -o PKGBUILD && makepkg -srci --noconfirm
cd ~ && rm -rf /tmp/PACKAGE
... but unfortunately makepkg needs root access for installing dependencies and the package itself.
Since I am not able to run makepkg with sudo rights, I cannot install any packages through an automatic script.
Is there any solution for doing this?
Thanks in advance!
Offline
Compling packages doesn't require root permissions but makepkg nees sudo for installing packages with pacman. You need to modify /etc/sudoers so that you can use "sudo pacman -U" without password prompt. As incorrect modification of /etc/sudoers may break sudo, I would suggest you to read wiki carefully before proceeding
Arch is home!
https://github.com/Docbroke
Offline
I cannot quite help you on the matter of automating the OS installation, but on the issue of fetching the PKGBUILDs like that:
There are quite some packages where you require other files than just the PKGBUILD - so you might rather want to download the entire archives (either as a tarball, or better, through git).
Last edited by ayekat (2017-01-10 08:45:39)
Offline
I second the above - except I think "some packages" puts it a bit to softly: many packages have files other than their PKGBUILD and your approach will just completely fail.
The good news is that using git eliminates some of your steps:
git clone https://aur.archlinux.org/${PKG}.git
pushd ${PKG}
makepkg -srci
popd
rm -rf ${PKG}
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
You need to modify /etc/sudoers so that you can use "sudo pacman -U" without password prompt
Yes, I was thinking of that as well. I thought there would be a better solution for that specific issue.
This is how I change the /etc/sudoers for my purpose:
echo PASSWORD | sudo -S bash -c 'echo "USER HOST=NOPASSWD: /usr/bin/pacman" | (EDITOR="tee -a" visudo)'
At the end of my script I just delete this line so that I have to type in my password for the pacman command again (the standard behaviour).
There are quite some packages where you require other files than just the PKGBUILD - so you might rather want to download the entire archives
My idea was to install an aur helper (e.g. packer) through this method (PKGBUILD) and then use the helper for the rest of my installation to get all the important stuff:
packer -G --noconfirm --noedit PACKAGE
Offline
May i suggest adding the aur helper to the archiso instead, by building a custom archiso.
Then call the aur helper with --root /mnt to install to the new installed system's root.
This assumes that the aur helper passes the --root option on to pacman.
That way you won't have to "bootstrap" the AUR because you have an AUR helper available right away.
Offline
Pages: 1