Offline installation

From ArchWiki

If you wish to install the Archiso (e.g. the official monthly release) as it is without an Internet connection, or, if you do not want to download the packages you want again:

First, follow the Installation guide, skipping the Installation guide#Connect to the internet section, until the Installation guide#Install essential packages step.

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/

Comment out [core], [extra] and [community] so that pacman does not fail on the default repositories.

Pacstrap

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

Chroot

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 /mnt prefix):

[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.