Welcome to the Arch Linux with Xfce4 and i3 Window Manager Installation Guide!
This guide provides you with a step-by-step walkthrough of installing Arch Linux along with the Xfce4 and i3 window manager. It has been carefully created based on my own experience of installation Arch Linux on multiple devices over the years. This guide aims to make your installation process as smooth as possible.
To begin your Arch Linux installation journey, please follow the step-by-step instructions provided below.
If you have any suggestions, corrections, or encounter any issues while following the guide, I encourage you to get involved through Github.
Issues: If you come across any problems or have specific questions, please open an issue on the Github repository for this guide. This allows me to track and address your concerns effectively.
Pull Requests: If you have improvements or additions to the guide, feel free to submit a pull request. Your contributions can help enhance the clarity of the guide for everyone.
Go to Arch Linux downloads page https://archlinux.org/download/
Find HTTP Direct Downloads section and choose any download mirror. Select a mirror that is geographically closer to your location.
On the mirror page find archive named like archlinux-YYYY.MM.DD-x86_64.iso
or archlinux-x86_64.iso
or any other file with .iso
suffix. Other files (like .txt, .tar.gz and even .iso.sig)
are not needed for installation process.
Insert a USB-stick into your PC with at least 2Gb of space availavle on it.
Find corresponding block device for USB-stick in /dev
folder. Usually it is /dev/sdb
.
/dev/sdb
):$ sudo dd conv=fsync oflag=direct status=progress if=./archlinux-YYYY.MM.DD-x86_64.iso of=/dev/sdb
Insert the installation medium into the computer on which you are installing Arch Linux.
Power on your PC and press boot menu key. For Lenovo ThinkPad X1 Carbon series laptop,
this key is F12
.
Boot from USB-stick and wait until boot process is finished.
iwctl
and check connection is established:$ iwctl [iwd]# station wlan0 get-networks [iwd]# station wlan0 connect <Name of WiFi access point> [iwd]# exit $ ping 1.1.1.1
$ pacman -Syy
fdisk
utility. You can find storage device name using lsblk
command.$ fdisk /dev/nvme0n1
[repeat this command until existing partitions are deleted]
Command (m for help): d
Command (m for help): d
Command (m for help): d
[create partition 1: efi]
Command (m for help): n
Partition number (1-128, default 1): Enter ↵
First sector (..., default 2048): Enter ↵
Last sector ...: +256M
[create partition 2: main]
Command (m for help): n
Partition number (2-128, default 2): Enter ↵
First sector (..., default ...): Enter ↵
Last sector ...: -32G // double size of your RAM
[create partition 3: swap]
Command (m for help): n
Partition number (3-128, default 3): Enter ↵
First sector (..., default ...): Enter ↵
Last sector ...: Enter ↵
[change partition types]
Command (m for help): t
Partition number (1-3, default 1): 1
Partion typr or alias (type L to list all): uefi
Command (m for help): t
Partition number (1-3, default 2): 2
Partion typr or alias (type L to list all): linux
Command (m for help): t
Partition number (1-3, default 3): 3
Partion typr or alias (type L to list all): swap
[write partitioning to disk]
Command (m for help): w
$ mkfs.fat -F 32 /dev/nvme0n1p1 # on EFI System partition $ mkfs -t ext4 /dev/nvme0n1p2 # on Linux filesystem partition $ mkswap /dev/nvme0n1p3 # on Linux swap partition
/mnt
:$ mount /dev/nvme0n1p2 /mnt $ mkdir -p /mnt/boot/efi $ mount /dev/nvme0n1p1 /mnt/boot/efi $ swapon /dev/nvme0n1p3
$ pacstrap -i /mnt base linux linux-firmware sudo vim $ genfstab -U -p /mnt > /mnt/etc/fstab
$ arch-chroot /mnt
$ vim /etc/locale.gen # uncomment your locales, i.e. `en_US.UTF-8` or `en_GB.UTF-8` $ locale-gen $ echo "LANG=en_US.UTF-8" > /etc/locale.conf # choose your locale $ ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime # choose your timezone $ hwclock --systohc
$ echo yourhostname > /etc/hostname $ vim /etc/hosts 127.0.0.1 localhost ::1 localhost 127.0.1.1 yourhostname
$ useradd -m -G wheel,storage,power,audio,video -s /bin/bash yourusername $ passwd root $ passwd yourusername
$ visudo [uncomment following line in file] %wheel ALL=(ALL) ALL
$ pacman -S grub efibootmgr $ grub-install /dev/nvme0n1 $ grub-mkconfig -o /boot/grub/grub.cfg
$ pacman -S dhcpcd networkmanager resolvconf $ systemctl enable dhcpcd $ systemctl enable NetworkManager $ systemctl enable systemd-resolved
$ exit $ umount /mnt/boot/efi $ umount /mnt $ reboot
$ timedatectl set-ntp true
nmcli
:$ nmcli device wifi connect <Name of WiFi access point> password <password>
$ sudo pacman -S xorg xorg-apps xorg-xinit xorg-xlsfonts xdotool xclip xsel
$ sudo pacman -S dbus # Message bus used by many applications $ sudo pacman -S intel-ucode # Microcode update files for Intel CPUs $ sudo pacman -S fuse2 # Interface for programs to export a filesystem to the Linux kernel $ sudo pacman -S lshw # Provides detailed information on the hardware of the machine $ sudo pacman -S powertop # A tool to diagnose issues with power consumption and power management $ sudo pacman -S inxi # Full featured CLI system information tool $ sudo pacman -S acpi # Client for battery, power, and thermal readings$ sudo pacman -S base-devel # Basic tools to build Arch Linux packages $ sudo pacman -S git # Distributed version control system $ sudo pacman -S zip # Compressor/archiver for creating and modifying zipfiles $ sudo pacman -S unzip # For extracting and viewing files in .zip archives $ sudo pacman -S htop # Interactive CLI process viewer $ sudo pacman -S tree # A directory listing program$ sudo pacman -S dialog # A tool to display dialog boxes from shell scripts $ sudo pacman -S reflector # Script to retrieve and filter the latest Pacman mirror list $ sudo pacman -S bash-completion # Programmable completion for the bash shell$ sudo pacman -S iw # CLI configuration utility for wireless devices $ sudo pacman -S wpa_supplicant # A utility providing key negotiation for WPA wireless networks $ sudo pacman -S tcpdump # Powerful command-line packet analyzer $ sudo pacman -S mtr # Combines the functionality of traceroute and ping into one tool $ sudo pacman -S net-tools # Configuration tools for Linux networking $ sudo pacman -S conntrack-tools # Userspace tools to interact with the Netfilter tracking system $ sudo pacman -S ethtool # Utility for controlling network drivers and hardware $ sudo pacman -S wget # Network utility to retrieve files from the Web $ sudo pacman -S rsync # File copying tool for remote and local files $ sudo pacman -S socat # Multipurpose socket relay $ sudo pacman -S openbsd-netcat # Netcat program. OpenBSD variant. $ sudo pacman -S axel # Light command line download accelerator $ sudo pacman -S bind # I use dig utility for DNS resolution from this package
# Instructions for installing Xfce4 $ sudo pacman -S xfce4 $ sudo pacman -S xfce4-notifyd xfce4-screensaver xfce4-screenshooter $ sudo pacman -S thunar-archive-plugin thunar-media-tags-plugin $ sudo pacman -S network-manager-applet $ sudo pacman -S xfce4-xkb-plugin xfce4-battery-plugin xfce4-datetime-plugin xfce4-mount-plugin xfce4-netload-plugin xfce4-wavelan-plugin xfce4-pulseaudio-plugin xfce4-weather-plugin xfce4-whiskermenu-plugin # Instructions for installing i3 $ sudo pacman -S i3-wm i3status i3lock pango $ sudo pacman -S lxappearance # You will most probably need these apps for i3 $ sudo pacman -S polybar # nice statusbar for i3-based UIs $ sudo pacman -S rofi # like dmenu, but more customizable $ sudo pacman -S ranger # console file manager $ sudo pacman -S alacritty # terminal emulator $ sudo pacman -S dunst # notification manager $ sudo pacman -S feh # fast and light image viewer $ sudo pacman -S xss-lock # screen lock controller $ sudo pacman -S flameshot # screenshot app $ sudo pacman -S gsimplecal # small calendar widget
ly
for it's minimalism:$ sudo pacman -S ly $ sudo systemctl enable ly
$ sudo pacman -S ttf-dejavu ttf-freefont ttf-liberation ttf-droid terminus-font $ sudo pacman -S noto-fonts noto-fonts-emoji ttf-ubuntu-font-family ttf-roboto ttf-roboto-mono
$ sudo pacman -S sof-firmware # Sound Open Firmware $ sudo pacman -S pulseaudio # A featureful, general-purpose sound server $ sudo pacman -S pavucontrol # PulseAudio Volume Control $ sudo pacman -S alsa-utils # Advanced Linux Sound Architecture - Utilities $ sudo pacman -S alsa-plugins # Additional ALSA plugins
$ sudo pacman -S bluez bluez-utils blueman $ sudo systemctl enable bluetooth
$ sudo pacman -S cups cups-filters cups-pdf system-config-printer hplip $ sudo systemctl enable cups.service
/usr/share/applications/system-config-printer.desktop
and set
Categories=System;Settings;X-XFCE-SettingsDialog;X-XFCE-HardwareSettings;
$ sudo pacman -S tlp tlp-rdw $ sudo systemctl enable tlp # execute following commands only if using TLP-RDW: $ sudo systemctl enable NetworkManager-dispatcher.service $ sudo systemctl mask systemd-rfkill.service $ sudo systemctl mask systemd-rfkill.socket
$ sudo systemctl enable fstrim.timer
$ sudo pacman -S arc-gtk-theme adapta-gtk-theme materia-gtk-theme $ sudo pacman -S papirus-icon-theme
$ sudo reflector --country Germany,Austria,Switzerland --fastest 10 --threads $(nproc) --save /etc/pacman.d/mirrorlist
$ sudo pacman -S nm-connection-editor networkmanager-openvpn
$ pacman -S vulkan-intel # only for systems with Intel graphics $ pacman -S nvidia-utils # only for systems with Nvidia graphics $ pacman -S amdvlk # only for systems with AMD graphics
$ reboot
Open your /etc/fstab
and find UUID for your swap partition
Open GRUB configuration file and add resume UUID to GRUB_CMDLINE_LINUX_DEFAULT
:
$ sudo vim /etc/default/grub Example: ... GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=<UUID of your swap partition>" GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=97d9e9f5-899f-4e9e-910e-623a5f665271" ...
$ sudo grub-mkconfig -o /boot/grub/grub.cfg
resume
hook:$ sudo vim /etc/mkinitcpio.conf Example: ... HOOKS="base udev resume autodetect modconf block filesystems keyboard fsck" ...
$ sudo mkinitcpio -p linux
$ sudo systemctl hibernate
$ sudo pacman -S chromium # web-browser $ sudo pacman -S obsidian # note-taking app $ sudo pacman -S mousepad # simple graphical text editor $ sudo pacman -S file-roller # archive manager $ sudo pacman -S evince # pdf viewer $ sudo pacman -S xournalpp # pdf editor $ sudo pacman -S libreoffice # office packages $ sudo pacman -S gimp # image editor $ sudo pacman -S gpick # color picker $ sudo pacman -S inkscape # vector graphics editor $ sudo pacman -S fontforge # fonts editor $ sudo pacman -S gparted # grphical disk management tool $ sudo pacman -S vlc # video player $ sudo pacman -S remmina # remote desktop client $ sudo pacman -S shotcut # video editing tool $ sudo pacman -S evolution # email client $ sudo pacman -S redshift # adjusts the color temperature of your screen $ sudo pacman -S neofetch # command-line system information $ sudo pacman -S obs-studio # screencasting and streaming app $ sudo pacman -S wireshark-qt # network protocol analyzer $ sudo pacman -S spotify-launcher # spotify client $ sudo pacman -S telegram-desktop # my preffered messenger $ sudo pacman -S rclone # manage or migrate files on cloud storage $ sudo pacman -S openvpn # openvpn client $ sudo pacman -S wireguard-tools # wireguard client $ sudo pacman -S arandr # gui for xrandr
$ git clone https://aur.archlinux.org/yay.git $ cd yay $ makepkg -si
$ sudo pacman -S neovim # powerful console editor $ sudo pacman -S zed # ultimate graphical editor $ sudo pacman -S tree-sitter # parsing system for programming tools $ sudo pacman -S tree-sitter-cli # cli tool tree-sitter parsers $ sudo pacman -S stow # configuration manager $ sudo pacman -S sqlite3 # console sqlite client $ sudo pacman -S tldr # collection of simplified man pages $ sudo pacman -S jq # cli json processor $ sudo pacman -S tmux # terminal session multiplexer $ sudo pacman -S nmap # network scanner with advanced features $ sudo pacman -S masscan # high performance network scanner $ sudo pacman -S pgcli # console client for PostgreSQL $ sudo pacman -S redis # console client for Redis $ sudo pacman -S apache # http server + some useful utilities (htpasswd) $ sudo pacman -S meld # git visual diff and merge tool $ sudo pacman -S websocat # command line client for websockets $ sudo pacman -S sshpass # noninteractive ssh password provider $ sudo pacman -S git-filter-repo # faster and safer git-filter-branch alternative
sudo setcap 'cap_net_raw+epi' /usr/bin/masscan
to enable
the ability to run masscan
as non-root user.
$ sudo pacman -S ansible # infrastructure as a code tool (bare metal) $ sudo pacman -S podman # cli tool for container management $ sudo pacman -S docker # cli tool for container management $ sudo pacman -S docker-compose # run multi-container applications with docker $ sudo pacman -S kubectl # cli tool for managing kubernetes clusters $ sudo pacman -S helm # package manager for kubernetes $ sudo pacman -S terraform # infrastructure as a code tool (clouds) # configure docker $ sudo systemctl enable docker # enable docker daemon on system start # sudo usermod -a -G docker yourusername # to be able to run docker as non-root $ newgrp docker # login to docker group without restart
$ sudo pacman -S go $ go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest $ go install github.com/hairyhenderson/gomplate/v4/cmd/gomplate@latest
$ sudo pacman -S jdk8-openjdk # OpenJDK Java 8 development kit $ sudo pacman -S jdk11-openjdk # OpenJDK Java 11 development kit $ sudo pacman -S jdk17-openjdk # OpenJDK Java 17 development kit $ sudo pacman -S jdk21-openjdk # OpenJDK Java 21 development kit $ sudo pacman -S jdk-openjdk # OpenJDK Java 22 development kit $ sudo pacman -S maven # Java project management tool $ sudo pacman -S gradle # Java project management tool
archlinux-java
. List all available
JVM versions using archlinux-java status
and set one using archlinux-java set VERSION
.
Install Dart and Flutter following instructions from https://docs.flutter.dev/get-started/install/linux
Install C, C++ and tools for low-level development:
$ sudo pacman -S gcc # GNU Compiler Collection, C and C++ frontends $ sudo pacman -S gdb # GNU Debugger $ sudo pacman -S clang # C/C++ frontend compiler for LLVM $ sudo pacman -S cmake # C/C++ project management tool $ sudo pacman -S ninja # Build system with a focus on speed $ sudo pacman -S cuda # NVIDIA GPU programming toolkit $ sudo pacman -S nasm # Asssembler for the x86 CPU architecture $ sudo pacman -S boost # C++ library with general purpose utils and data structures $ sudo pacman -S cdrtools # CD/DVD/BluRay command line recording software $ sudo pacman -S qemu-full # Open source machine emulator and virtualizer
$ sudo pacman -S python # python itself $ sudo pacman -S python-pip # python package manager $ sudo pacman -S python-poetry # python package manager (better one)
$ sudo pacman -S lua # Collection of Lua tools
$ sudo pacman -S nodejs # JavaScript runtime $ sudo pacman -S npm # JavaScript package manager $ sudo pacman -S yarn # JavaScript package manager
$ sudo pacman -S rust # Rust compiler and tools for project management
$ sudo pacman -S linux-headers # Headers for building Linux kernel modules $ sudo pacman -S virtualbox-host-dkms # VirtualBox Host kernel modules sources $ sudo pacman -S virtualbox # Hypervisor for x86 virtualization
$ sudo pacman -S plantuml # Tool for creating UML diagrams
$ sudo pacman -S hugo # fast and flexible static site generator in go $ sudo pacman -S dart-sass # implementation of sass (required for hugo)
$ sudo pacman -S gnucash # Personal and small-business financial-accounting application
$ sudo pacman -S freecad # Feature based parametric 3D CAD modeler $ sudo pacman -S prusa-slicer # G-code generator for 3D printers
/etc/pacman.conf
and uncomment (or add) following lines:[multilib] Include = /etc/pacman.d/mirrorlist
$ sudo pacman -Syu
$ sudo pacman -S wine # Compatibility layer for running Windows programs $ sudo pacman -S wine-mono # Wine's replacement for Microsoft's .NET Framework $ sudo pacman -S wine-gecko # Wine's replacement for Microsoft's Internet Explorer $ sudo pacman -S winetricks # Installer for various runtime libraries in Wine $ sudo pacman -S zenity # Display dialog boxes from shell scripts (wine dependency)
$ winetricks settings fontsmooth=rgb
wine: Read access denied for device L"\??\Z:\", FS volume label and serial are not available
,
go to ~/.wine/dosdevices
, remove z:
symbolic link and make it point to your $HOME
$ wget http://mirrors.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
$ mkdir ./texlive $ tar -xvf install-tl-unx.tar.gz -C texlive --strip-components=1
$ cd ./texlive $ sudo ./install-tl -select-repository
Download zip-archive from here: https://developer.android.com/studio from Command line tools only section.
Unpack archive and copy cmdline-tools to $ANDROID_HOME
(in my case ~/Android
):
$ unzip commandlinetools-linux-..._latest.zip # archive you got from website $ mkdir -p ~/Android/cmdline-tools/latest $ mv ./cmdline-tools/* ~/Android/cmdline-tools/latest/
Set ANDROID_HOME
environment variable to ~/Andoird
in .bashrc
Install platform tools, build tools and accept all licenses:
$ sdkmanager "platform-tools" "platforms;android-29" $ sdkmanager "build-tools;29.0.3" $ sdkmanager --licenses $ sdkmanager --update
$ sudo pacman -S yubikey-manager $ sudo pacman -S yubikey-personalization-gui
Binary reverse engineering:
gdb
, strace
, ltrace
, ldd
, objdump
radare2
, frida
,
Ghidra
, IDA Pro
, cutter
+ rz-ghidra
+ cutterref
, angr-management
API Monitor
, PEiD
, UpxUnpacker
Python: pycdc
Java: jd-gui
, jadx
C#: Avalonia ILSpy
In some Linux kernels there are some broken USB 3.0 device drivers, that sometimes wake up
the system right after you launch hibernation process. If you see errors like this in your
dmesg
command output after an unsuccessful hibernation:
xhci_hcd 0000:00:14.0: PM: pci_pm_freeze(): hcd_pci_suspend+0x0/0x20 returns -16 xhci_hcd 0000:00:14.0: PM: dpm_run_callback(): pci_pm_freeze+0x0/0xc0 returns -16 xhci_hcd 0000:00:14.0: PM: failed to freeze async: error -16
To fix the issue put following lines in /usr/lib/systemd/system-sleep/xhci
and make this file executable:
#!/bin/sh run_pre_hook() { echo "Disable xhci module before suspend at $(date)..." >> /tmp/systemd_suspend_log grep XHC.*enable /proc/acpi/wakeup && echo XHC > /proc/acpi/wakeup } run_post_hook() { echo "Enable xhci module after wakeup from $(date)" >> /tmp/systemd_suspend_log grep XHC.*disable /proc/acpi/wakeup && echo XHC > /proc/acpi/wakeup } case $1 in pre) run_pre_hook ;; post) run_post_hook ;; esac
Original solution: https://gist.github.com/ioggstream/8f380d398aef989ac455b93b92d42048
This can help if you have very tiny grub font on your 4k monitor
/etc/default/grub
with text editor and add following lines:GRUB_TERMINAL_OUTPUT="gfxterm" GRUB_GFXPAYLOAD_LINUX=keep GRUB_GFXMODE=1920x1080x32,1024x768x32,auto
grub.cfg
:$ sudo grub-mkconfig -o /boot/grub/grub.cfg
This can help if you use lightdm and have very tiny font on your 4k monitor
Open /etc/lightdm/lightdm.conf
file and add following line under [Seat:*]
section:
display-setup-script=xrandr --output eDP-1 --mode 1920x1080P.S. your screen output name, like eDP-1 in my case, can be found in
xrandr -q
$ gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
Settings -> Screensaver -> Activate Screensaver when computer is idle
.resolvectl revert wg0
(change wg0
to your wireguard interface name).
This will prevent system from using Wireguard interface for all routes.xrender
to glx
and check if it helps.
Worked for me.Window -> Always show menu bar -> disable
/dev/sdb1
) and initialize LUKS:$ sudo cryptsetup luksFormat /dev/sdb1
/dev/mapper/cryptdev
:$ sudo cryptsetup open /dev/sdb1 cryptdev
ext4
:$ sudo mkfs.ext4 /dev/mapper/cryptdev
/mnt
folder in this example, and use it as you want:$ sudo mount /dev/mapper/cryptdev /mnt
$ sudo umount /mnt $ sudo cryptsetup close cryptdev