I wanted to use my cloud server to compile large projects for me.
For that, I needed to create a chroot environment to keep my main system clean and which will handle that process.
Here's how I did...
My chroot environment: /mnt/chroot
cd /mnt
wget <path-to-bootstrap-image>/archlinux-bootstrap-*-x86_64.tar.gz
tar xzf ./archlinux-bootstrap-*-x86_64.tar.gz
mv root.x86_64 chroot # Optional: Change the name of the bootstrap folder.
rm archlinux-bootstrap-*-x86_64.tar.gz # Optional
- Uncomment the mirror you want in
/mnt/chroot/etc/pacman.d/mirrorlist
. - Comment the
CheckSpace
directive in/mnt/chroot/etc/pacman.conf
to avoid free space disk issues with Pacman in a chroot environment.
arch-chroot /mnt/chroot
# You can ignore the following message:
# ==> WARNING: /mnt/chroot/ is not a mountpoint. This may have undesirable side effects.
Populate the keys.
pacman-key --init
pacman-key --populate archlinux
useradd -m archie
# With root privileges:
# NOTE: Don't forget to uncomment one of the "%wheel" lines in /etc/sudoers!
useradd -G wheel -m archie
Here's some package that you can install afterward.
base
is highly recommanded.
pacman -S base base-devel fakeroot gzip sudo
You'll need to use the user created at step 4.1 for this operation.
su - archie # Considering you're still as root.
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si # Will install Go.
# Optional: Remove the "yay" folder. You don't need it anymore.
cd ..
rm -rf ./yay