Jump to content

DeveloperWiki talk:Building in a clean chroot

From ArchWiki

More info needed RE: archbuild

With the semi-recent changes to chroot building and the addition of the archbuild convenience script, using a custom repo within your build chroot is no longer supported. It is therefore required to create (or symlink) a pacman.conf to /usr/share/devtools/pacman-<some_name>.conf, and then run <some_name>-x86_64-build to build packages in a chroot that will have access to your custom repo.

For more background, see this reddit post and this response thread.

Terminalmage (talk) 01:39, 10 December 2019 (UTC)Reply

updating this comment from 2019... I think this page needs an update by someone more familiar with devtool package. Mainly a note about arch-nspawn usage/sideeffects over chroot. Gcb (talk) 09:35, 22 May 2024 (UTC)Reply

Adjusted mirrorlist can be over written when up dating the chroot

Quoting the end of 3.1 Setting up a chroot

Also adjust the mirrorlist in $CHROOT/root/etc/pacman.d/mirrorlist

Quoting the beginning of 3.2 Building in the chroot

Firstly, make sure the base chroot ($CHROOT/root) is up to date:
$ arch-nspawn $CHROOT/root pacman -Syu

Depending on the configuration, the adjusted mirrorlist can be over written when making sure the base chroot is up to date. Should the article point out the possible over write?

Regid (talk) 15:39, 18 March 2023 (UTC)Reply

do not recommend manual chroot creation in /home/$USER

As of pacman 7, the alpm user needs access to the chroot dir. Currently, the recommendation here is to create ~/chroot but does not clarify that the group of that dir needs to be set to :alpm

I think a simple solution would be to either

a) recommend creating /chroot (at the base of the file system), or

b) instruct that a chown :alpm ~/chroot needs to be run after the mkdir

Feinedsquirrel (talk) 15:46, 1 October 2024 (UTC)Reply

This may have already been address, but I created the chroot in `~/arch/chroot` just to be sure. After creating the chroot and building packages, the directory permission were still `david:david`. No file or directory ownership was changed to `:alpm` -- thankfully. David C. Rankin, J.D.,P.E. -- Rankin Law Firm, PLLC (talk) 07:11, 10 February 2025 (UTC)Reply
I don't understand why setting the alpm group is required. After creating the directory, the article suggests to run mkarchroot. /usr/bin/mkarchroot sources /usr/share/devtools/lib/archroot.sh, which has check_root, and runs check_root. In short, my understanding is that without root privileges, one can not proceed. Since root privileges are a necessity, ownership can be set automatically if it is a requirement. Regid (talk) 01:59, 10 March 2026 (UTC)Reply

Add Tip how to add custom/AUR packages to Convenience way

Add a Tip to section 2 (Convenience way) about how to add a custom / AUR package as follows:

extra-x86_64-build -- -I /packages/foobar/foobar-2-1-any.pkg.tar.xz Lquidfire (talk) 07:27, 23 October 2024 (UTC)Reply

Introduce extra-x86_64-build before makechrootpkg

extra-x86_64-build also syncs dependencies automatically while makechrootpkg does not. oech3 (talk) 13:56, 15 June 2025 (UTC)Reply

Quoting Revision as of 10:17, 15 November 2024, which looks to me the revision of the article at the time of oech3's comment
To quickly build a package in a clean chroot without any further tinkering, one can use the helper scripts from the devtools package.
It goes on reading about extra-x86_64-build. The whole section is found before reading about makechrootpkg. Doesn't that address oech3's comment? Regid (talk) 00:58, 10 March 2026 (UTC)Reply