How to install a minimal Archlinux system

This tutorial is for peoples that wants to install the Archlinux with a minimal desktop tools and utilities. I will consider that you is an Linux user and knows how to use the terminal and its tools. Archlinux is installed by command lines, so I’ll put here only the commands necessary to install the system. If you want to know more about these steps, so you can search the internet or use the man page of your Linux distribution. Let’s go!

Download the Archlinux and boot it on your computer. You can create usb bootable disk using the dd linux tool.

# dd if=archlinux.iso of=/dev/sdb status=progress

Replace /dev/sdb with the path of your removable disk.

Archlinux installation

List your disks and get the path of hard disk that you want to install the system.

# fdisk -l

My hard disk path is /dev/sda, so to create the system partition scheme I have to run:

# cfdisk /dev/sda

I will use three partitions on my system. One for swap, other for system and other for home:

  • /dev/sda1 is my swap partition
  • /dev/sda2 is the system partition /
  • /dev/sda3 is my home partition /home

Now we have to format the disk:

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

After partitioning the disk we have to mount that.

# mkswap /dev/sda1
# mount /dev/sda2 /mnt
# mkdir /mnt/home
# mount /dev/sda3 /mnt/home

Mounting the home partition now is only required to generate de fstab configuration.

After creating the system partitions, formatting and mounting them, we be able to install the archlinux base system.

We need network connection to install the archlinux, so check your network configuration:

# ip a

Obtaining the automated IP configuration:

# dhclient <network adapter name>

Connecting in the wi-fi network:

# wpa_passphrase wi-fi-network-name password > wifi.conf
# wpa_supplicant -B -i wi-fi-adapter -c wifi.conf
# dhclient wi-fi-adapter

Test your network connection:

# ping archlinux.org

Install the base packages:

# pacman -Sy
# pacman -S archlinux-keyring
# pacstrap /mnt base linux grub

Generate the fstab configuration:

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

Switch to the new system:

# arch-chroot /mnt
Configuring the new system

Configure the hostname and hosts files:

# echo archlinux > /etc/hostname
# echo "127.0.0.1  localhost" > /etc/hosts
# echo "::1  localhost" >> /etc/hosts

Set the console keyboard map:

# echo "KEYMAP=us" > /etc/vconsole.conf

Change the system language:

Edit the /etc/locale.gen file and remove the # character of the line that contains your language, and apply the settings:

# locale-gen

Install the grub bootloader:

# pacman -Sy
# pacman -S grub
# grub-install /dev/sda
# grub-mkconfig -o /boot/grub/grub.cfg

Set the time and date:

# ln -sf /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime
# hwclock --systohc

Replace “America/Sao_Paulo” with your locale. You can search on zoneinfo directory to see more locales available.

Install a text editor to edit system config files:

# pacman -S nano vim

Install network tools:

# pacman -S wpa_supplicant dhclient net-tools

Create a new user:

# useradd -m -U -G video,audio,power,storage,network,wheel,lp username
# passwd username

Now we have a basic system with the tools needed to configure the network and edit the system files. If you reboot your computer now, you can enter on the new archlinux system.

If you want a minimal graphical system desktop, so make the following procedures. These next steps are optionally and you can replace the suggested software’s with the ones you like.

To run a graphical environment we need a graphical server, so we have to install the xorg packages:

# pacman -S xorg xorg-xinit xorg-common

Install the minimal graphical environment packages:

# pacman -S openbox lxappearance lxappearance-obconf lxde-common lxinput lxlauncher lxlauncher lxpanel lxrandr lxsession lxterminal pcmanfm

Now create the .xinitrc file to start the graphical environment:

$ echo "exec lxsession" > ~/.xinitrc

After booting your system and authenticating, to start the graphical environment you have to execute the following command:

$ startx

Our system is ready! But its needs some software’s for daily usage.

Install a web browser:

# pacman -S firefox

or:

# pacman -S chromium

Image viewer:

# pacman -S gpicview

Calculator:

# pacman -S galculator

Word processor:

# pacman -S abiword

Tools for automated removable device mount:

# pacman -S gvfs fuse2 fuse3 libmtp gvfs-mtp

Torrent download manager:

# pacman -S transmission-gtk

Command line download manager:

# pacman -S wget

Install a firewall:

# pacman -S ufw
# ufw enable

Graphical text editor:

# pacman -S mousepad

Video player:

# pacman -S mpv

Add support for multimidia:

# pacman -S gst-plugins-base gst-plugins-good gst-plugins-bad

Sound server to listen audio:

# pacman -S alsa alsa-lib alsa-utils alsa-firmware pipewire-alsa pipewire-pulse pipewire-jack pavucontrol

Graphical network manager:

# pacman -S networkmanager network-manager-applet

Music player:

# pacman -S audacious

Document viewer:

# pacman -S evince

Install a graphical login manager:

# pacman -S lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings lightdm-webkit2-greeter light-locker
# systemctl enable lightdm
# systemctl start lightdm

This tutorial is for a minimal system desktop environment, so if you need more software’s in your system, you can install it.

Compartilhar artigo

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *