Prepare local repository
Follow Pacman/Tips and tricks#Installing packages from a CD/DVD or USB stick for instructions on preparing a local repository with the necessary files on a separate host installation.
At the very least, for a functioning system, the following packages are recommended:
# pacman -Syw --cachedir . --dbpath /tmp/blankdb base base-devel linux linux-firmware systemd mkinitcpio vim
Create your custom offline repository
# repo-add ./custom.db.tar.gz ./*[^sig]
Mount and configure
Once the repository is prepared, connect the external media to the new installation, and mount it on the newly created root filesystem:
# mkdir /mnt/repo # mount /dev/sdX /mnt/repo
Edit your archiso
/etc/pacman.conf and add a new section:
[custom] SigLevel = Optional Server = file:///mnt/repo/
[community] so that pacman does not fail on the default repositories.
You can now continue to pacstrap your locally-available packages to the new installation:
# pacstrap /mnt base base-devel linux linux-firmware mkinitcpio systemd vim
In case the new system is expected to remain offline or airgapped, it should be configured to expect local repositories only.
After chrooting into your new installation, edit the new
/etc/pacman.conf in the same way as previously (but without the
[custom] SigLevel = Optional Server = file:///repo/
Comment out all other repositories and save. Continue configuring the new system as usual.
From now on any updates to the offline system can be made by bringing an up to date copy of the local repository, mounting it to
/repo and running pacman commands as usual.