Pacstrap
From the pacstrap(8):
- Pacstrap is designed to create a new system installation from scratch.
Installation
Tips and tricks
Creating a clean chroot
Currently, devtools only supports sudo. This can not be changed as devtools require the use of the complex functionality of sudo, which opendoas does not support. You can use Pacstrap to create a chroot manually.
First, create the chroot directory:
# mkdir /var/chroot
Then, install the base system and base-devel (meta package containing tools which are used by the makepkg utility):
# pacstrap -K /var/chroot base base-devel
-K
flag initialises a new pacman keyring, instead of using the hosts keyring, for people who are using unofficial mirrors within their chroot and want to import their keys from the host can omit this flag.If you have not mounted a partition to /var/chroot
, you must bind the directory on itself to make it a mountpoint, therefore ensuring compatibility with arch-chroot.
# mount --bind /var/chroot /var/chroot
Then you can enter the chroot, using arch-chroot:
# arch-chroot /var/chroot
You can not build arch pages as root, makepkg does not permit the use of the root, due to security concerns. Create a build user:
# useradd -m build
-m
flag is needed to ensure that useradd creates the home directory of the build user with the correct permissions.You can then become the build user using the following command:
# su -l build
-l
flag is used to change into the home directory of the user you are becoming, this prevents you from accidentally trying to read/write to the root home directory.You can now build any AUR package you wish by cloning them into the chroot, or use the chroot for testing and debugging of arch packages.