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.
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.
- The Arch Linux wiki installation guide
- The Arch Linux for Dummies guide which covers EFI installation
- The Howtoforge Arch Linux installation with full disk encryption tutorial
- The Viva O Linux! post which covers the installation in brazilian portuguese
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.
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
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:
- Run
fdisk /dev/sda
- Use the
o
option to set the DOS partiton table label - Enter the
n
option to add a new partition - Hit ENTER to keep the partition as primary
- Hit ENTER to skip the partition number
- Hit ENTER to skip the first partition sector
- Set
+100M
as the last partition sector - Enter the command
a
and set the partition number1
as bootable
Then, the Linux swap:
- Enter the
n
option to add a new partition - Hit ENTER to keep the partition as primary
- Hit ENTER to skip the partition number
- Hit ENTER to skip the first partition sector
- Set
+8G
as the last partition sector - Enter the command
t
, set the partition number2
as type82
(Linux swap/Solaris)
And finally, the root partition and writing to the partition table:
- Enter the
n
option to add a new partition - Hit ENTER to keep the partition as primary
- Hit ENTER to skip the partition number
- Hit ENTER to skip the first partition sector
- Hit ENTER to skip the last partition sector
- 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
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!
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