You are not logged in.
I'm trying to install an AUR package in an automated script (specifically, libcgroup). Here is the relevant code:
cd "$(mktemp -d)"
git clone https://aur.archlinux.org/libcgroup.git
chown -R nobody:nobody libcgroup
cd libcgroup
sudo -u nobody makepkg
pacman -U libcgroup-*.pkg.tar.zst
The script is run as root, so I switch to the nobody user to run makepkg. However, I get this error:
==> ERROR: Failed to create the directory $BUILDDIR (/tmp/tmp.A5deoAF5dp/libcgroup).
Aborting...
This is particularly weird because the referenced BUILDDIR already exists (it's the current directory). Can anyone help me?
Offline
you'll want to switch to the nobody user earlier, you can't access the tmp directory you've created as root from the nobody user. It can't create the libcgroup directory which is the error you get. mktemp creates directories/files that only the executing/current user can access.
Last edited by V1del (2021-03-19 08:46:04)
Offline
I got this error while trying to install yay. **yay does not like to run as root, or under the /root folder** (directly or indirectly). The problem was that I tried to do everything under /root directory: cloned the yay git package into /root/downloads, then **chown** the git file (and directory) to user arch, then switched user to arch (su arch), then tried to run makepkg... The solution was simple - **switch to arch user first**:
su arch
cd /home/arch
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
Offline
Please do not necrobump.
Closing.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline