Setting Up Archlinux using chroot: The lazy way

Setting up Archlinux is fun. For an interested beginner, it’s an enlightening experience. You get to know what package are needed to build and run your system, step by step, and it also gives this good feeling of being in power. So recently, I tried to do a fresh Archlinux install. This was on the laptop, in which I already had a perfectly working Ubuntu already installed. Usually, on PC, connecting internet in the minimal environment of arch is as simple as connecting the Ethernet cable and forgetting it. But this time, I had only wireless to rely on. Since the mere thought of taking out the eth cable from those unimaginable knots behind the desktop is enough to give me the shivers, and since I had no previous experience setting up wireless in Arch, I was facing some  troubles. I left the task after a few vain attempts in which I realised I should have taken care to select and install the necessary packages for wireless during installation of Archlinux core.

But leaving a task undone is annoying. Every time I boot up, the Archlinux entry in grub seemed to be looking at me hopefully, awaiting its turn to be a ready to use installation. So eventually this thought occurred to me: Why not use chroot in Ubuntu to fix all issues and get Archlinux working?

The little previous experience I had with chrooting into Archlinux was when I tried to remake the kernel image after update in the desktop. I was then positively amused by the fact that an internet connection set up in Ubuntu could well serve Archlinux and help it fetch the packages even in that environment. If it could fetch then, why not now? Let the hacking begin! (Bit too enthusiastic, I know 😀 )

As always, I looked  up the Archlinux wiki on Changing Root and followed the instructions:

mkdir /mnt/arch
mount /dev/<device-or-partition-name> /mnt/arch
cd /mnt/arch
mount -t proc proc proc/
mount -t sysfs sys sys/
mount -o bind /dev dev/
mount -t devpts pts dev/pts/
chroot . /bin/bash

With these, I was able to run a pacman -Syu and get the packages. I could also install wireless_tools and wpa_supplicant, the two packages which I should have selected during the installation for configuring wireless. Even then, configuring wireless was yet another adventure. Linux continues to be fun!

4 thoughts on “Setting Up Archlinux using chroot: The lazy way

  1. I had to build a kernel image from within a chroot environment :-/
    My box is up and running again thanks to your lazy way of doing it 🙂

    Thank you very much !!!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s