Install from existing Linux

This guide is intended for anybody who wants to install Arch Linux from any other running Linux -- be it off a LiveCD or a pre-existing install of a different distro.

This is useful for building up new Arch Linux systems from scratch from another distro's LiveCD or existing installation. It is also useful for creating new chroot environments on a "host" system, maintaining a "golden-master" for development & distribution, or other fun topics like rootfs-over-NFS for diskless machines.

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.

Prepare the system

Follow the Installation Guide steps, until you have your partitions, keyboard and internet connection ready.

Setup the enviroment for the arch install scripts

You need to create an environment where pacman and the arch install scripts can run on your current linux distro. In addition you will need a list of pacman mirror sites which are going to be used to download data on available packages as well as the packages themselves.

Here a different methods to prepare that environment:

Method: Installing pacman and other packages directly under another distro

Warning: This method is potentially difficult, your mileage may vary from distro to distro. If you just want to do an arch installation from another distro and you are not interested in have pacman as a regular program under such distro, is better to use a different method.

This method is about installing pacman and the arch install scripts directly under another distro, so they become regular programs on that distro.

This is really useful if you are planning to use another distro regularly to install arch linux, or do fancy things like updating packages of an arch installation using another distro. This is the only method that not imply creating a chroot to be able to execute pacman and the arch install scripts. (but since part of the installation includes entering inside a chroot, you'll end using a chroot anyway)

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:

Method: Use the alternate easier method

This method is verified to be working as of 1-4-12.
This works best if you are in a LiveCD environment (or, in the case of servers, a GNU/Linux-based rescue environment). Firstly, you need to mount the disk you want to use for the Archlinux installation at /mnt. In this example, /dev/sda1 is used.

Method: Chroot into the Arch Linux LiveCD

Alternatively, you can mount the root image of the latest archlinux 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.

Unsquash the root image

The root image exists in squashfs format on the Live CD. The squashfs format is not editable as such. Hence, we unsquash the root image and then mount it.

To unsquash the root image, run

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

Mount root file system

Then, mount the unsquashed root file system to a suitable mount point. We shall mount it to /arch. You can mount it wherever you want.

This chroot is able to execute the arch install scripts. The destination partitions should be mounted under the /mnt directory from this chroot.

Method: Script to bootstrap the arch install scripts

You can run the following script to automatically download the minimum packages required to run pacman and the arch install scripts.
Your current linux environment require bash, wget, sed, xz, chroot and tar installed.

Script

Create a file called archinstall-bootstrap.sh and put the following content:

Finish the Installation

Now just do the rest of the steps normally.

Tips and tricks

If you are using this method because you are trying to do a remote install, like a vps, and can't umount the root partition, and, assuming the system has a swap partition large enough (about 600mb or larger), one path is to delete that partition, create the partitions for arch in that area, and install arch there (only base, not base-devel). Once the system is installed, you can reboot to your new arch system, reformat the former partitions, and rsync the entire system there. At that point, next step would be to reconfigure grub or syslinux.