Arch August 8, 2023

Arch Linux Install on Laptop with Minimal Gnome

A short but compact tutorial for installation of Arch & Gnome

Introduction:

I’ve tried to install Arch Linux on my laptop, like, for three times. Since it’s a CLI process, some laptop-specific issues are required to addressed during the installation, especially the WIFI configuration which bogged me twice. Therefore I made this article to help anyone who would like to give a shot for Arch Linux on laptop, with gnome desktop minimal installation.

Notice & Notation:

This one is not for those who are new to Linux, so I would ignore minor points including how to write an ISO into the USB and boot from it. Furthermore, I don’t offer reasons or comments for each operation, so you’d better to have the experience of other Linux distribution before trying Arch, and adjust configurations as your willing.

Notation:

  • CAPITAL WORDS, e.g. WIFI_NAME, should be replaced by yourself.
  • /* */ denotes comment for operation.
  • [ ] represents an action to do, mostly editing files.

Download:

You should always download the ISO from official web: Arch official installation

1. Configure the terminal font

/* this one fits with a 2k screen */
# setfont ter-132b

2. Verify if the laptop allows for GRUB bootloader

/* the return value should be 64 */
# cat /sys/firmware/efi/fw_platform_size

3. Connect to the WIFI under live environment

# iwctl
> device list
> station wlan0 scan
> station wlan0 get-networks
> station wlan0 connect WIFI_NAME

4. Calibrate the system time

# timedatectl

5. Partition the disk using parted

# lsblk
/* to get the correct disk name and partition */

# parted
> print devices
> select /dev/NVME_NAME 
/* e.g. /dev/nvme0n1 */

> rm EXISTING_PART_NUMBERS 
/* e.g. 1, 2, 3... etc */

> mkpart "EFI system partition" fat32 1M 501M
> set 1 esp on

> mkpart "swap partition" linux-swap 501M 17G
> mkpart "root partition" ext4 17G 100%
> quit

I personally find parted much easier to understand comparing to fdisk.

6. Format the partitions, then mount them

# mkfs.ext4 /dev/NVME_ROOT_PART 
/* e.g. /dev/nvme0n1p1 */

# mkswap /dev/NVME_SWAP_PART
# mkfs.fat -F 32 /dev/NVME_EFI_PART

# mount /dev/NVME_ROOT_PART /mnt
# mkdir -p /mnt/boot
# mount /dev/NVME_EFI_PART /mnt/boot
# swapon /dev/NVME_SWAP_PART

7. Install the basic Linux components into mounted disk

# pacstrap -K /mnt base linux linux-firmware

If the download speed is too low, edit the file /etc/pacman.d/mirrorlist with the format of Server = MIRROR_URL. You may search for arch Linux mirrors of your own country to fill in and delete all the others to ensure the downloading speed.

8. Send the fstab info into the mounted disk

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

9. Chroot into the mounted disk

# arch-chroot /mnt

10. Set the time zone and hardware clock

# ln -sf /usr/share/zoneinfo/REGION/CITY /etc/localtime
# hwclock --systohc

11. Install packages necessary for GRUB and rebooting into GUI

# pacman -S vim grub efibootmgr networkmanager sudo

12. Enable the usage of wheel group for sudo

# visudo
[uncomment the line of "%wheel ALL=(ALL:ALL) ALL"] 

13. Configure the localization

# vim /etc/locale.gen
[uncomment the line of "en_US.UTF-8 UTF-8"]
# locale-gen
# vim /etc/locale.conf
[add one line of "LANG=en_US.UTF-8"]

14. Set your host name on network

# vim /etc/hostname
[input whatever you like to be the hostname]

15. Create a new initramfs

# mkinitcpio -P

16. Install and configure GRUB

# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
# grub-mkconfig -o /boot/grub/grub.cfg

17. Install minimal size of Gnome

# pacman -S gdm gnome-control-center gnome-keyring gnome-shell gnome-terminal xdg-user-dirs

These packages, I believed, are the minimal collection for Gnome to barely work.

18. Enable the essential services of GUI

# systemctl enable gdm NetworkManager

19. Configure your own user with sudo and home directory

# useradd -m -G wheel USER_NAME
# passwd root
[set root password, input twice]
# passwd USER_NAME
[set user password, input twice]

20. Return to the live environment and reboot into GUI Linux of Arch

# exit
# umount -R  /mnt
# reboot

Since I didn’t include gnome-background in this article, I attached a well-crafted 4K wallpaper hereā¬†, made by an artist of Reddit/Archlinux.

Copyright: Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)

Author: Benny

Posted on: August 8, 2023