Offline installation - ArchWiki

Jump to content

Related articles

- Offline installation of packages

This article provides instructions on installing Arch Linux on a system without an Internet connection. To do this, another system with a working Internet connection is required.

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

This article or section needs expansion.

Reason: Add optional instructions on placing the custom repo in the ISO. (Discuss in Talk:Offline installation)

Once the repository is prepared, connect the external media to the new installation, and mount it on the newly created root filesystem:

    # mount --mkdir /dev/sdxy /mnt/repo

Edit your archiso `/etc/pacman.conf` and add a new section:

    /etc/pacman.conf

    [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 -K /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):

    /etc/pacman.conf

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

Categories:

- Live Arch systems
- Installation process

Hidden category:

- Pages or sections flagged with Template:Expansion