Difference between revisions of "Install Arch from within another distro"

From ArchWiki
Jump to: navigation, search
(update re glibc locale changes)
(Kernel requires some tools that might not be on the original system; if we chroot the problem is solved.)
Line 23: Line 23:
 
Once you have setup the filesystems, mount them. Throughout this, I have mounted the new Arch /, to /newarch, however you can put it wherever you like.
 
Once you have setup the filesystems, mount them. Throughout this, I have mounted the new Arch /, to /newarch, however you can put it wherever you like.
  
===Install System===
+
===Install Base System===
 
Update pacman
 
Update pacman
 
  pacman.static -Sy -r /newarch
 
  pacman.static -Sy -r /newarch
Line 46: Line 46:
 
  pacman.static -S `cat packages` -r /newarch
 
  pacman.static -S `cat packages` -r /newarch
  
Install your preferred kernel,
+
===Prepare System===
pacman.static -S kernel26 -r /newarch
 
pacman.static -S kernel26archck -r /newarch
 
 
 
If you wish to install extra packages now, you may do so with:
 
pacman.static -S packagename -r /newarch
 
 
 
===Configure System===
 
 
Mount various filesystems into the new Arch system.
 
Mount various filesystems into the new Arch system.
 
  mount /dev/ /newarch/dev/ --bind
 
  mount /dev/ /newarch/dev/ --bind
Line 67: Line 60:
 
  mknod -m 660 null c 1 3
 
  mknod -m 660 null c 1 3
  
 +
===Install The Rest===
 +
Install your preferred kernel,
 +
pacman.static -S kernel26 -r /newarch
 +
pacman.static -S kernel26archck -r /newarch
 +
 +
If you wish to install extra packages now, you may do so with:
 +
pacman.static -S packagename -r /newarch
 +
 +
===Configure System===
 
Edit your /etc/fstab, remembering to add /, swap and any other partitions you may wish to use.
 
Edit your /etc/fstab, remembering to add /, swap and any other partitions you may wish to use.
  

Revision as of 03:41, 4 September 2006

How to install Arch from within a liveCD or other distro

Setup host system

Install pacman within the host distro. The simplest way is to grab the latest pacman from in: ftp://ftp.archlinux.org/current/os/i686 cd to /, and extract the pacman.pkg.tar.gz you just downloaded.

Configure your /etc/pacman.conf to your liking

Prepare disk for Arch

Prepare the new Arch system's filesystems and then mount them. If your host system has any gui tools for this, such as gparted, cfdisk, or mandrakes diskdrake, feel free to use them.

To format a partition as ext3, you run (where /dev/hdxx is the partition you want to setup):

mkfs.ext3 /dev/hdxx

as reiserfs:

mkreiserfs /dev/hxx

swap:

mkswap /dev/hdxx

Most other filesystems can be setup with their own mkfs variant, take a look with tab completion. Available filesystems depend entirely on your host system.

Once you have setup the filesystems, mount them. Throughout this, I have mounted the new Arch /, to /newarch, however you can put it wherever you like.

Install Base System

Update pacman

pacman.static -Sy -r /newarch

At this point, you might get the following error message

$ pacman.static -Sy -r /newarch
:: Synchronizing package databases... 
getservbyname: No such file or directory

TODO: Write out a solution for this problem


pacman.static -S bash -r /newarch
pacman.static -S pacman -r /newarch
pacman.static -S filesystem -r /newarch

Install all of base. I put a list of base packages in a file called 'packages' which is at the end of this page.

pacman.static -S `cat packages` -r /newarch

Prepare System

Mount various filesystems into the new Arch system.

mount /dev/ /newarch/dev/ --bind
mount /sys/ /newarch/sys/ --bind
mount /proc/ /newarch/proc/ --bind

Chroot into the new system

chroot /newarch

Ensure the correct /dev nodes have been made for udev:

cd /dev
mknod -m 660 console c 5 1
mknod -m 660 null c 1 3

Install The Rest

Install your preferred kernel,

pacman.static -S kernel26 -r /newarch
pacman.static -S kernel26archck -r /newarch

If you wish to install extra packages now, you may do so with:

pacman.static -S packagename -r /newarch

Configure System

Edit your /etc/fstab, remembering to add /, swap and any other partitions you may wish to use.

Edit your rc.conf to your liking

Edit /etc/locale.gen, uncommenting any locales you wish to have available, and build the locales

locale-gen

Setup Bootloader

Edit your preferred bootloader's config and install it. I had problems with grub, so I configured and installed lilo.

NOTE: for grub use an old trick from the gentoo handbook

# grep -v rootfs /proc/mounts > /etc/mtab

this allows grub-install to run properly while chrooted

Instructions for GRUB and LILO are available on this wiki.

Install Complete

Reboot to your new system!

Package list

file less nano rp-pppoe autoconf libpcap ncurses sed automake findutils libtool net-tools shadow flex libusb openssl slocate bin86 gawk licenses sysfsutils binutils gcc lilo pam syslog-ng bison gdbm logrotate patch sysvinit bzip2 gettext lshwd pciutils tar coreutils glibc lzo2 pcmciautils tcp_wrappers cpio grep m4 perl udev cracklib groff mailx popt usbutils db grub make ppp util-linux dcron gzip man procinfo vim man-pages procps wget dhcpcd initscripts mawk psmisc which diffutils iputils mkinitrd raidtools wireless_tools e2fsprogs jfsutils mktemp readline xfsprogs ed kbd module-init-tools reiserfsprogs zlib