Skip to content

Instantly share code, notes, and snippets.

@vbarboza
Last active September 17, 2018 12:12
Show Gist options
  • Save vbarboza/fd76544bf89cf27beb8408c08c37e8e0 to your computer and use it in GitHub Desktop.
Save vbarboza/fd76544bf89cf27beb8408c08c37e8e0 to your computer and use it in GitHub Desktop.

Arch Linux Quick Install

This is a quick guide for installing the Arch Linux distribution without too much PITA. Thus, I am not not encrypting the disk with LUKS, but here's a tutorial.

My system is an old laptop with an Intel chipset, 4GB of RAM, 500GB of disk and no VGA. EFI boot is not supported, but here's another good tutorial covering this case.

References

This guide is based in a few others which I have used myself.They have a set of much more complete instructions regarding each steps of the installation process. If this is your first time installing Arch, I'd start with one of the following as I did.

After a few custom installations, I have summarized the main ideas which worked for my use case. Notice that not everything might work for you. Feel free to reproduce, adapt and share this guide as you please.

Live USB

After downloading an ISO image, burn it to an USB drive:

dd if=~/Downloads/<arch linux image> of=/dev/<device name> status=progress

And boot the system from the Arch Linux libe USB.

Installation

The following commands set the environment for a brazilian portuguese keyboard layout (ABNT2) and connects to a wireless network.

loadkeys br-abnt2
wifi-menu
systemctl start dhcpcd

Filesystem

First check the device name into which you want to install the operating system. We are overwritting its filesystem.

lsblk

A DOS partition table is written with:

  • a 100 MiB boot section
  • 8 GiB swap (2x the avilable RAM)
  • everything else for the root EXT4 filesystem

First set the partition table label and add a bootable partition:

  1. Run fdisk /dev/sda
  2. Use the o option to set the DOS partiton table label
  3. Enter the n option to add a new partition
  4. Hit ENTER to keep the partition as primary
  5. Hit ENTER to skip the partition number
  6. Hit ENTER to skip the first partition sector
  7. Set +100M as the last partition sector
  8. Enter the command a and set the partition number 1 as bootable

Then, the Linux swap:

  1. Enter the n option to add a new partition
  2. Hit ENTER to keep the partition as primary
  3. Hit ENTER to skip the partition number
  4. Hit ENTER to skip the first partition sector
  5. Set +8G as the last partition sector
  6. Enter the command t, set the partition number 2 as type 82 (Linux swap/Solaris)

And finally, the root partition and writing to the partition table:

  1. Enter the n option to add a new partition
  2. Hit ENTER to keep the partition as primary
  3. Hit ENTER to skip the partition number
  4. Hit ENTER to skip the first partition sector
  5. Hit ENTER to skip the last partition sector
  6. Write everything to the partition table with the w.

The following commands format the bootable and root partitions as EXT4 and configures the Linux swap.

mkfs.ext4 /dev/sda1
mkswap /dev/sda2
swapon /dev/sda2
mkfs.ext4 /dev/sda3

Before starting the Arch Linux installation on the root partition, it must be mounted (as well as the bootable partition).

mount -t ext4 /dev/sda3 /mnt
mkdir -p /mnt/boot
mount -t ext4 /dev/sda1 /mnt/boot

Packages and configuration

First, install the base system to the root partition.

pacstrap /mnt base base-devel

And update the filesystem table.

genfstab -U /mnt >> /mnt/etc/fstab

Then enter the Arch Linus system:

arch-chroot /mnt

And change some default configurations:

# install a text editor
pacman -S nano
# change hostname
echo archie > /etc/hostname
# uncomment en_US.UTF-8 UTF-8 and set the locale
nano /etc/locale.gen
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
# then set the keymap
echo KEYMAP=br-abnt2 > /etc/vconsole.conf
# configure the datetime
ln -sf /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime
hwclock --systohc --utc

Then install Grub.

pacman -S sudo grub os-prober intel-ucode
mkinitcpio -p linux
grub-install /dev/sda
grub-mkconfig /boot/grub/grub.cfg

Configure users.

passwd
useradd -m -G wheel vinicius
passwd vinicius
EDITOR=nano visudo

ANd finally the internet:

pacman -S networkmanager
systemctl enable NetworkManager.service

The following commands, install essential packages:

# Upgrade the system
pacman -Syu
# Audio and Video
pacman -S alsa pulseaudio-alsa xf86-video-intel
# Input devices
pacman -S libinput
# X
pacman -S xorg xorg-server xorg-xinit xterm
# i3 and
pacman -S i3 dmenu ttf-font-awesome
echo exec i3 > ~/.xinitrc
# Programming packages
pacman -S emacs gcc make autoconf tar unzip

And you are ready to reboot.

exit
umount -a
reboot

Remember to remove the USB Live disk and use your username and password when starting the system.

Now you can rice your i3 and install everything else.

Happy hacking!

About me

Computer Engineer working with R&D for science and industry for a couple of years. I have experience on embedded systems and computer vision - working mainly with C, Python and MATLAB.

Feel free to contact me. E-mail and social links follow.

viniciusdearaujob [at] google mail [dot] com | github | twitter | linkedin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment