Logo
Arch Linux Installation

Arch Linux Installation

October 25, 2019
5 min read
index

Why?

As you can notice, there are various tutorials in the net for the keyword “Arch installation”. As an Arch user, I will recommmend you to take a look at the Arch wiki for such an installation progess instead. So what is the purpose of this post? You may ask.

First of all, this post serves as a snippset for my arch installation. I don’t want to forget anything esstensial for my daily workflow incase I have to make a complete reinstall. Secondly, as personalized as this installation guide may seems, it may help new users in some ways.

Danger (Important)

This installation guide is very outdated. Always follow the official guide from the ArchWiki for porper up-to-date instructions.

Now let’s get started:

Warning (Caution)

/dev/nvme0n1 should be replaced with /dev/sda depending on different hardware.

Setting up

Setting up network

Terminal window
ip link
wifi-menu

Disks partition

Terminal window
lsbk
cgdisk /dev/nvme0n1
PartitionsSpaceTypeLable
/dev/nvme0n1p1512Mef00boot
/dev/nvme0n1p24G8200swap
/dev/nvme0n1p3remaining8300system

Format partitions

1. EFI partition

Terminal window
mkfs.fat -F32 /dev/nvme0n1p1

2. Activate swap

Terminal window
mkswap /dev/nvme0n1p2
swapon /dev/nvme0n1p2

3. System partition

Terminal window
mkfs.ext4 /dev/nvme0n1p3

Mount and setting up

Terminal window
$ mount /dev/nvme0n1p3 /mnt
$ mkdir /mnt/boot
$ mount /dev/nvme0n1p1 /mnt/boot
$ df

Installation

Select mirror

Terminal window
$ nano /etc/pacman.d/mirrorlist

Place your host of choice on top:

Terminal window
Server = http://abcdxyz.example.com/archlinux/$repo/os/$arch

Install base system

Terminal window
$ pacstrap /mnt base linux linux-firmware neovim
$ genfstab -U /mnt
$ genfstab -U /mnt >> /mnt/etc/fstab
$ cd /mnt/etc
$ cat fstab

Chroot into system: setting up timezone, passwd,…

Terminal window
$ arch-chroot /mnt
$ ln -sf /usr/share/zoneinfo/ / /etc/localtime
$ hwclock --systohc --utc
$ nvim /etc/locale.gen` then uncomment `en_US.UFT-8`
$ locale-gen
$ echo "LANG=en_US.UFT-8" > /etc/locale.conf
$ nvim /etc/hostname
$ passwd
$ useradd -g users -G wheel,storage,power -m ashpex

or

Terminal window
localectl set-locale LANG=en_US.UTF-8

Setting up Bootloader

Terminal window
$ pacman -S grub efibootmgr
$ grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
$ pacman -S os-prober
$ grub-mkconfig -o /boot/grub/grub.cfg

Setting up wifi

Terminal window
$ pacman -S networkmanager wireless_tools wpa_supplicant network-manager-applet
$ exit
$ reboot

Install yay

Terminal window
$ git clone https://aur.archlinux.org/yay.git
$ cd yay
$ makepkg -si

Enable ntp

Terminal window
$ pacman -S ntp
$ systemctl enable ntpd
$ systemctl start ntpd
$ timedatectl set-ntp 1

Install DEs or WM.

Gnome

Terminal window
$ sudo pacman -Syu
$ sudo pacman -S xorg xorg-server
$ sudo pacman -S gnome
$ sudo systemctl start gdm.service
$ sudo systemctl enable gdm.service
$ sudo pacman -S pulseaudio pulseaudio-alsa

i3

Terminal window
$ sudo pacman -S i3-gaps dunst dmenu picom feh mpd mpv ranger rofi scrot neovim xorg xorg-server pulseaudio pulseaudio-alsa alsa-utils nemo alacritty firefox git zathura
Terminal window
$ yay polybar ranger-git
Tip (Tip)

Install light package to control brightness. It works better than xbacklight and supports Wayland.

XFCE

Terminal window
sudo pacman -S xfce4 xfce4-goodies

Conclusion

That’s pretty much the whole installation of your Arch Linux system. You can customize your OS more later such as things like ricing,… The fun has just begun. Here are some screenshots of my machine over time.

2019-08_scrot 2019-12_scrot 2020-05_scrot 2021-03_scrot

Troubleshooting

Wifi icon 1

Initial Requirements

  1. Hosts

    Check the configuration of your /etc/hosts file, a valid configuration looks like this:

    Terminal window
    #<ip-address> <hostname.domain.org> <hostname> 127.0.0.1 localhost.localdomain yourHostname ::1 localhost.localdomain yourHostname
  2. Devices

  • You can identify your networking devices like this:

    Terminal window
    lspci | grep -i net
  • If your device is not listed, it is maybe an usb-device, so try this command:

    Terminal window
    lsusb
  • With the following command you can check the current state of all your network-devices:

    Terminal window
    ip link

Installation of Required tools

  1. Install the wpa_supplicant tools

    Terminal window
    sudo pacman -S wpa_supplicant
  2. the wireless tools

    Terminal window
    sudo pacman -S wireless_tools
  3. Install the networkmanager

    Terminal window
    sudo pacman -S networkmanager
  4. Install the network-manager-applet aka nm-applet

    Terminal window
    sudo pacman -S network-manager-applet
  5. Install gnome-keyring

    Terminal window
    sudo pacman -S gnome-keyring
  6. Configuration

  • Make the networkmanager start on boot:

    Terminal window
    sudo systemctl enable NetworkManager.service
  1. Disable dhcpcd
  • Since networkmanager wants to be the one who handles the dhcpcd related stuff, you have to disable and stop dhcpcd:

    Terminal window
    $ sudo systemctl disable dhcpcd.service
    $ sudo systemctl disable dhcpcd@.service
    $ sudo systemctl stop dhcpcd.service
    $ sudo systemctl stop dhcpcd@.service
  1. Enable wpa_supplicant, if you want to use your wireless connection:

    Terminal window
    sudo systemctl enable wpa_supplicant.service
  2. Add your user to the network group:

    Terminal window
    gpasswd -a <USERNAME> network
  3. Turn off your network interface controllers, in my case eth0 and wlan0:

    Terminal window
    $ ip link set down eth0
    $ ip link set down wlan0
  • Now start wpa_supplicant:

    Terminal window
    $ ip link set down eth0
    $ ip link set down wlan0
  • Now Start the networkmanager:

    Terminal window
    sudo systemctl start NetworkManager.service

Finally, you should see the tray-icon on the top bar.

Sudoers 2

Logging as root

Terminal window
visudo

Add another line after this one

Terminal window
root ALL=(ALL) ALL

With: (by pressing O, then :X to save)

Terminal window
username ALL=(ALL) ALL

Footnotes

  1. Install Network-manager-applet (tray-icon) on Arch Linux GNOME 3.20

  2. Take Control of your Linux | sudoers file: How to with Examples