Professional Documents
Culture Documents
Arch
A basic installation with all base packages should take less than 800 MB of disk space.
The last arch linux version can be downloaded at archlinux.org/download (BitTorrent
download recommended). The image can be burned to a CD, mounted as an ISO file, or
be directly written to a USB stick using a utility like dd (Win32DiskImager on Windows). If
arch is been installed in a virtual machine (like VirtualBox), just create your disc, and start
it from the ISO file. The ISO image supports both 32bit and 64bit systems.
After booting into the installation media, you will be automatically logged in as
the root user and presented with a zsh shell prompt. For modifying or creating
configuration files, nano will be used. Fell free to use vim in case you have experience
with it.
UEFI mode
This tutorial will consider that you have a UEFI motherboard with UEFI mode enabled. To
verify you are booted in UEFI mode, check that the following directory is populated:
# ls /sys/firmware/efi/efivars
Note: If arch is been installed in a VM, remember to change the motherboard settings to
support UEFI/efivars.
Preparation
Make sure your internet connection is working (it probably should):
# ping google.com
If no connection is available, see Network configuration. You can also use the wifi-
menu command to connect to WiFi.
Make sure your system clock is accurate:
# lsblk
!Note: In this section, the "sdxy" notation will be used, where x represents device
and y represents partition (eg. sda1, sda2, sdb1, etc...).
# parted /dev/sdx
If you run a print, you will see the partition label is not defined. Let's set the partition
label to gpt:
(parted) mklabel gpt
If you print again, you will now be able to see an empty partition table. In this tutorial,
we are going to create a basic gpt with 3 partitions (first for boot, second for swap, and
third for our data). The boot partition can have a size between 260Mb and 512Mb. The
swap partition needs to have at least your RAM size (it's recomemnded to have 2x RAM
size). The remaning space is going to be allocated to your data. Let's format:
(parted) mkpart ESP fat32 1MiB 513MiB
(parted) set 1 boot on
(parted) mkpart primary linux-swap 513M 3G
(parted) mkpart primary ext4 3G 100%
You can print again to check if your partition table is ok. Exit from parted with:
(parted) quit
Formatting
You need to format each of your partitions, except for swap. All available partitions on
device can be listed with the following command:
# lsblk /dev/sdx
Format the boot partition to fat32:
# mkswap /dev/sdx2
# swapon /dev/sdx2
Then, format your data partition:
# mkfs.ext4 /dev/sdx3
If you want, you can check your partitions with lsblk again.
Mount the partitions
Mount the root partition to the /mnt directory of the live system:
# mkdir /mnt/boot
# mount /dev/sdx1 /mnt/boot
Installation
Execute the pacstrap script to install base packages:
# pacstrap /mnt
Generate an fstab file, to define how disk partitions should be mounted into the
filesystem:
# tzselect
Go to /usr/share/zoneinfo and find your Zone:
# cd /usr/share/zoneinfo
# ls
Go to your zone folder, and find your Subzone:
# cd MY_ZONE
# ls
Create the symbolic link /etc/localtime, to your Zone and Subzone:
ln -s /usr/share/zoneinfo/MY_ZONE/MY_SUBZONE /etc/localtime
It is recommended to adjust the time skew, and set the time standard to UTC:
Network configuration
Set the hostname by adding an entry to /etc/hostname, where MY_HOSTNAME is the
desired host name:
Run ip link to find your ethernet interface name (it should starts with en, eg. enp0s25).
# ip link
When only requiring a single wired connection, enable the dhcpcd service,
where MY_EN is your ethernet interface:
better way
# pacman -S networkmanager
# systemctl enable NetworkManager.service
# nmtui-connect
Change root password and reboot
Set the root password with:
# passwd
Exit from the chroot environment:
# exit
Reboot into the new system:
# reboot
Note: Remember to remove the CD (or ISO in case of VM)
User management
Install the package sudo:
# pacman -S sudo
Create an user for you, where MY_USERNAME is your username:
# logout
Driver installation
First, identify your card:
VirtualBox Settings
Skip this if arch is not installed in a VM.
$ mkdir ~/.config
$ echo export XDG_CONFIG_HOME="$HOME/.config" >> ~/.zshrc
$ mkdir ~/.config/bspwm
$ cp /usr/share/doc/bspwm/examples/bspwmrc ~/.config/bspwm/
$ mkdir ~/.config/sxhkd
$ cp /usr/share/doc/bspwm/examples/sxhkdrc ~/.config/sxhkd/
$ chmod +x ~/.config/bspwm/bspwmrc
Look at ~/.config/sxhkd/sxhkdrc and learn the key bindings. To start bspwm on login,
add the following to ~/.xinitrc
exec bspwm