You need to create an enviroment 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.

+

You need to create an enviroment 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 enviroment:

Here a different methods to prepare that enviroment:

Revision as of 18:13, 7 November 2012

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 enviroment 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 enviroment:

Method: Installing pacman and other packages directly under your current distro

Introduction

You need to get the required packages for your host Linux environment. The examples given here assume you are using an i686 environment. If you are running on a 64-bit Linux instead you should replace each occurrence of "i686" with "x86_64".

All version numbers given here may change. Please check the version numbers the packages are at first and note them down. The version numbers can be found at:

To prepare for using pacman, do not forget to edit /tmp/archlinux/etc/pacman.conf to point to /tmp/archlinux/etc/pacman.d/mirrorlist and select your favorite mirror. For easier use (assuming you are using bash or zsh), you may set up an environment:

Install pacman on the host system

Note: (Issues while running pacman on 64-bit host) If while running pacman you end up with /tmp/archlinux/usr/bin/pacman: No such file or directory please symlink ld-linux-x86-64.so.2: ln -s /lib64/ld-linux-x86-64.so.2 /lib/

If you do not mind littering your install host, you can extract all the downloaded tar balls into your root directory by running as root:

Note: However, keep in mind that this operation could erase some of your files, and break your system.

cd /
for f in /tmp/archlinux/pacman-*pkg.tar.gz ; do
tar xzf $f
done

If installing from Ubuntu 9.10's LiveCD (perhaps other versions), you will need more than just the pacman files (shared libs) to use pacman at all. Use Lucky's script described in [this thread] to get/install them for you!

Alternatively, you can instead turn these tarballs into packages for your distribution with the alien tool. See the man page of the tool for instructions. The packages created that way may be installed into your host distribution using the usual package management tools available there. This approach offers the best integration into the host Linux environment. For a Debian package based system this is done with the following commands:

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