Updated installation guide: https://wiki.archlinux.org/index.php/installation_guide
# Listing all available layouts:
ls /usr/share/kbd/keymaps/**/*.map.gz
# Loading portuguese layout:
loadkeys pt-latin1
# If the directory does not exist, the system may be booted in BIOS or CSM mode.
ls /sys/firmware/efi/efivars
ip link
ping google.com
timedatectl set-ntp true
# To check if the time is correct:
timedatectl status
# List available disks
fdisk -l
# Partition the disks using cfdisk:
cfdisk /dev/sdX
Partition | Size | Type |
---|---|---|
Boot | 512M | 1 - EFI System |
Swap | Double your RAM | 19 - Linux swap |
/ (Root) | Rest of the free space | 20 - Linux filesystem |
# Format root partition
mkfs.ext4 /dev/sdX1
# Format the boot partition (if created):
mkfs.fat -F32 /dev/sdX2
# Initialize swap
mkswap /dev/sdX3
swapon /dev/sdX3
# Mount root partition
mount /dev/sdX1 /mnt
# Create a boot directory
mkdir /mnt/boot
# Mount boot (UEFI) partition
mount /dev/sdX2 /mnt/boot
# Delete mirrors outside of Europe
vim /etc/pacman.d/mirrorlist
pacstrap /mnt base linux linux-firmware vim nano
genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt
ln -sf /usr/share/zoneinfo/Portugal /etc/localtime
hwclock --systohc
# Edit /etc/locale.gen and uncomment what you want:
vim /etc/locale.gen
# Generate locale
locale-gen
# Configure /etc/locale.conf:
vim /etc/locale.conf
# and set the LANG variable accordingly:
LANG=en_US.UTF-8
# If you set the keyboard layout, make the changes persistent with:
vim /etc/vconsole.conf
# and set the KEYMAP variable accordingly:
KEYMAP=pt-latin1
# Create /etc/hostname with your hostname:
vim /etc/hostname
# Add your hostname like:
myhostname
127.0.0.1 localhost
::1 localhost
127.0.1.1 myhostname.localdomain myhostname
# If you only have a wired connection, dhcpcd is sufficient and less complicated
pacman -S dhcpcd
systemctl enable dhcpcd
# If you also need to handle Wi-Fi, NetworkManager is better
pacman -S networkmanager
systemctl enable networkmanager
# Set root password
passwd
# Adding a new user
useradd -m yourusername
passwd jmfp
# Adding user to groups
usermod -aG wheel,power,audio,video,optical,storage yourusername
# Allow wheel group members to execute any command
visudo
# Uncomment the line "%wheel ALL=(ALL) NOPASSWD: ALL"
# Use pacman to install grub, efibootmgr and os-prober
pacman -S grub efibootmgr os-prober
# Install grub on the system
grub-install --target=x86_64-efi --efi-directory=/boot
# If you have or plan on dual booting with Windows, mount it's partition in order to os-prober detect it when generating the grub config
mkdir /mnt/windows
# Find the windows partition with (fdisk -l, lsblk, blkid, etc) and mount it
mount /dev/sdXX /mnt/windows
# Generate a grub config file
grub-mkconfig -o /boot/grub/grub.cfg
# Exit chroot
exit
# Optionally manually unmount all the partitions
umount -R /mnt
# Finally reboot
reboot
# Install Xorg
sudo pacman -S xorg xorg-xinit
There are a lot of options: https://wiki.archlinux.org/index.php/Desktop_environment
# Install bspwm
sudo pacman -S bspwm sxhkd
# Install the default config
mkdir -p .config/bspwm
mkdir .config/sxhkd
cp /usr/share/doc/bspwm/examples/bspwmrc ~/.config/bspwm/
cp /usr/share/doc/bspwm/examples/sxhkdrc ~/.config/sxhkd/
There are a few options: https://wiki.archlinux.org/index.php/Display_manager
# Install lightdm
sudo pacman -S lightdm
# Install a greeter
sudo pacman -S lightdm-gtk-greeter
# Change the config to the installed greeter
sudo vim /etc/lightdm/lightdm.conf
# [Seat:*]
# ...
# greeter-session=lightdm-gtk-greeter
# Enable the service
systemctl enable lightdm
Polkit is necessary to control system-wide privileges and ask the user to enter the administrator password when necessary
# Install the polkit package
sudo pacman -S polkit
# If you are using a graphical environment, make sure that a graphical authentication agent is installed and autostarted on login (lxsession is a lightweight alternative)
# There are a few options: https://wiki.archlinux.org/index.php/Polkit
sudo pacman -S lxsession
sudo setxkbmap -layout pt
# Install xdg-user-dirs
sudo pacman -S xdg-user-dirs
# Create the default directories
xdg-user-dirs-update
-
base-devel (building and compiling packages)
-
git
-
linux-headers
-
dialog (boxes for shell scripts)
-
pkgfile (to search files from packages)
-
yay (installing packages from aur)
git clone https://aur.archlinux.org/yay.git cd yay makepkg -si
-
gvfs-smb (support for SMB networking protocol)
-
ntfs-3g (reading ntfs)
-
tlp (power management for laptops)
-
bluez, bluez-utils and blueman (bluetooth support)
-
Fonts:
-
ttf-ms-fonts - AUR (Most of Microsoft fonts)
-
ttf-windows - AUR (Other Microsoft fonts, like Segoe UI)
-
noto-fonts (general unicode support, important for browsers)
-
noto-fonts-emoji (emojis)
-
noto-fonts-cjk (chinese, japanese and korean character support, fairly large package)
-
powerline-fonts (improved powerline fonts to support symbols)
git clone https://github.com/powerline/fonts.git --depth=1 cd fonts ./install.sh
-
nerd-fonts-complete (optional, has a lot of fonts)
-
If you plan on dual booting with windows, it's installation will probably break grub, to recover it follow these steps:
- Boot an Arch Linux live cd
- Chroot into your installation:
# Check the correct partitions
fdisk -l
# Mount the root partition
mount /dev/sdX1 /mnt
# Mount the boot partition
mount /dev/sdX3 /mnt/boot
# Chroot into the installation
arch-chroot /mnt
- Reinstall grub by following the steps on 4.5