| ↑↑ Home | ↑ UNIX |
This also works to install Arch on a disk that is to become the system disk of
another computer. This is briefly described
here
, but
there are some additional caveats as well as shortcuts if you already have a
comparable system. To make best use of this, you need an internal or external
enclosure in which you can attach a bare hard disk to your computer (otherwise,
you would have to temporarily build the new system disk into your existing
computer). This is how I have repeatedly created new Arch Linux installations
both at work and at home.
To avoid confusion farther on, let me give names to the three systems involved:
The three systems need not all be different -- for example, the template system could be the same as the host system. The template system may not exist at all, if you want to create a new installation rather than clone one. The host system has to be able to run software on the target system, but otherwise need not be the same CPU architecture -- for example, it may be an x86_64 system when you want to create an i686 system.
I will assume you have already partitioned the target disk and created a file system on the system partition. Then you proceed as follows.
filesystem bash gawk grep file glibc ncurses readline sed acl archlinux-keyring attr bzip2 coreutils curl e2fsprogs expat gcc-libs gnupg gpgme keyutils krb5 libarchive libassuan libgpg-error libgcrypt libidn libssh2 lz4 lzo openssl pacman xz zlib pacman-mirrorlist tar libcap arch-install-scripts util-linux systemdThis list of packages is copied from the shell script arch-bootstrap.sh
linked from the
Wiki
page
, look there for an up-to-date list.
package on the host. This contains the arch-chroot script which creates
bind mounts for /proc and /dev and others before chroot'ing, which
saves a lot of hassle. If you host runs a different Linux, you could try
downloading the scripts from
here
, but you may
have to make modifications to arch-chroot if it is not completely
compatible.
This
section
describes how to do the necessary bind mounts manually. (One should
mention that --rbind mounts are next to impossible to unmount again
— try something like grep <mountpoint> /proc/mounts | awk '{ print
$2; }' | sort -ru | while read m ; umount -n $m ; done or be prepared to
reboot.)pacman-key --init pacman-key --populate archlinux
pacman -Qneq | sort > /root/tmp/explicit-packages pacman -Qndq | sort > /root/tmp/depend-packagesThe list of dependency packages may not be strictly necessary. It helps recreate exactly the same system in case you came to rely on a dependency package that is not needed by an explicitly installed package any more and would therefore not be installed automatically. The sorting is also not necessary, but allows to compare lists with diff between different systems or times.
cat /root/tmp/explicit-packages | pacman -S --needed - cat /root/tmp/depend-packages | pacman -S --needed --asdeps -The --needed prevents reinstallation of packages we installed already. As noted above, installing the dependency packages may be redundant. (The pacman commands above are from the commendable Wiki page "pacman tips"
.)
.
.