This document describes the bootstrapping process required to install Arch Linux from a running Linux host system.
After bootstrapping, the installation proceeds as described in the Installation Guide.

The goal of the bootstrapping procedure is to setup an environment from which arch-install-scripts (such as pacstrap and arch-root) run.
This goal is achieved by installing arch-install-scripts natively on the host system, or setting up an Arch Linux-based chroot.

Note: This guide requires that the existing host system be able to execute the new target Arch Linux architecture programs. In the case of an x86_64 host, it is possible to use i686-pacman to build a 32-bit chroot environment. See Arch64 Install bundled 32bit system. However it is not so easy to build a 64-bit environment when the host only supports running 32-bit programs.

Arch Linux-based chroot

The idea is to run an Arch system inside the host system.
The actual installation is then executed from this Arch system.
This nested system is contained inside a chroot.
Three methods to setup and enter this chroot are presented below, from the easiest to the most complicated.

Method 2: Using the LiveCD Image

It is possible to mount the root image of the latest Arch Linux installation media and then chroot into it. This method has the advantage of providing you with a working Arch Linux installation right within your host system without the need to prepare it by installing specific packages.

Note: Before proceeding, make sure the latest version of squashfs is installed on the host system. Otherwise you will get errors like: FATAL ERROR aborting: uncompress_inode_table: failed to read block.

The root image can be found on one of the mirrors under either arch/x86_64/ or arch/i686/ depending on the desired architecture. The squashfs format is not editable so we unsquash the root image and then mount it.

To unsquash the root image, run

# unsquashfs -d /squashfs-root root-image.fs.sfs

Now you can loop mount the root image

# mkdir /arch
# mount -o loop /squashfs-root/root-image.fs /arch

Before chrooting to it, we need to set up some mount points and copy the resolv.conf for networking.

Now everything is prepared to chroot into your newly installed Arch environment

# chroot /arch bash

Method 3: Assembling the chroot Manually (with a script)

The script creates a directory called archinstall-pkg and downloads the required packages in it. It then extracts them in the archinstall-chroot directory. Finally, it prepares mount points, configures pacman and enters a chroot.

Install dependencies

Using your distribution mechanisms, install the required packages for pacman and the arch install scripts. libcurl, libarchive, fakeroot, xz, asciidoc, wget, and sed are among them. Of course, gcc, make and maybe some other "devel" packages are necessary too.

Compile pacman

If you get errors here, chances are you are missing dependencies, or your current libcurl, libarchive or others, are too old. Install the dependencies missing using your distro options, or if they are too old, compile them from source.

Compile

make

If there were no errors, install the files

make install

You may need to manually call ldconfig to make your distro detect libalpm.

Prepare configuration files

Now is time to extract the configuration files. Change the x86_64 as necessary.

Extract the pacman.conf and makepkg.conf files from the pacman package, and disable signature checking:

Another option is using the alien tool to convert the pacman-mirrorlist and arch-install-scripts (but no pacman) to native packages of your distro.

Replacing the Existing System without a LiveCD

Find ~500MB of free space somewhere on the disk, e.g. by partitioning a swap partition.
Install the new Arch Linux system there, reboot into the newly created system, and rsync the entire system to the primary partition.
Fix the bootloader configuration before rebooting.