Arch Linux installation guide

Install Arch on nvme drive, UEFI system

Change layout

I will set the layout in French, because I am French.

loadkeys fr
language-noneCopy

Set password

This is the first step for me, because without password I can’t use SSH.

passwd
language-noneCopy

Connect via SSH

I will use ssh to copy past the commands,
To get you’r IP addresse.

ip a
language-noneCopy

look like this for me: 192.168.0.25

On your other computer open a terminal or putty of what you want to connect via SSH.

Partitions

to see your hard drive.

fdisk -l
language-noneCopy

Delete them.

cfdisk /dev/nvme0n1
language-noneCopy
cfdisk /dev/sda
language-noneCopy

Create 3 partition,

1: 512Mb EFI

2: 20Gb File system (root)

2: 80Gb File system (home)

And Format them:

This one for EFI

mkfs.fat -F32 /dev/nvme0n1p1
language-noneCopy

The two other like this:

mkfs.ext4 /dev/nvme0n1p2
language-noneCopy
mkfs.ext4 /dev/nvme0n1p3
language-noneCopy

Them mount the root partition

mount /dev/nvme0n1p2 /mnt
mkdir /mnt/home
mount /dev/nvme0n1p3 /mnt/home
language-noneCopy

Install the system

pacstrap -i /mnt base linux linux-firmware sudo nano
language-noneCopy

Generate fstab file

genfstab -U -p /mnt >> /mnt/etc/fstab
language-noneCopy

Chroot to the installed system

arch-chroot /mnt /bin/bash
language-noneCopy

Set root password

To set a root password

passwd
language-noneCopy

Create a new user

useradd peanutstick -m
language-noneCopy

set the password

passwd peanutstick
language-noneCopy

Set locale

uncomment the right line, for me it’s fr_FR.UTF-8 UTF-8, because I am French!

nano /etc/locale.gen
language-noneCopy

now generate it.

locale-gen
language-noneCopy

Create a locale.conf file.

echo "LANG=fr_FR.UTF-8 UTF-8" > /etc/locale.conf
language-noneCopy

Set the time zone

ln -sf /usr/share/zoneinfo/
language-noneCopy

Now select your time zone

ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime
language-noneCopy

Set local time

hwclock --systohc --utc
language-noneCopy

To check it:

date
language-noneCopy

Set hostname

echo peanutstick > /etc/hostname
language-noneCopy

Also add the name in /etc/hosts

nano /etc/hosts
language-noneCopy

it should look like this:

127.0.0.1       localhost
::1             localhost
127.0.1.1       peanutstick
language-noneCopy

Enable network

Install the network manager:

pacman -S networkmanager
language-noneCopy

Enable it:

systemctl enable NetworkManager
language-noneCopy

If you don’t do this part, your computer will not be able to connect to the network and you will not be able to download the packet.

Install GRUB

Install Grub and efibootmgr

pacman -S grub efibootmgr
language-noneCopy

install the bootlader:

mkdir /boot/efi
mount /dev/nvme0n1p1 /boot/efi
grub-install --target=x86_64-efi --bootloader-id=GRUB --efi-directory=/boot/efi --removable
grub-mkconfig -o /boot/grub/grub.cfg
language-noneCopy

Reboot

exit
umount -R /mnt
reboot
language-noneCopy

Change boot order

don’t pull out the USD stick, and select the last option to change the settings.

Set the right boot order, to boot on your hdd or ssd.

Disable speaker

My computer do a big BIP when I press tab or do something wrong:

rmmod pcspkr
language-noneCopy

To make it persistent:

nano /etc/modprobe.d/nobeep.conf
language-noneCopy

And write:

blacklist pcspkr
language-noneCopy

Permanent KEYMAP

nano /etc/vconsole.conf
language-noneCopy

I will write:

KEYMAP=fr
language-noneCopy

Add User to Sudoers

As root:

nano /etc/sudoers
language-noneCopy

add this to the end:

peanutstick ALL=(ALL) NOPASSWD:ALL
language-noneCopy

Be careful, the user can be root by just typing sudo su, sudo /bin/bash and more

Install sshd

pacman -S openssh
language-noneCopy

Swap File

You probably have noticed that I have not created a Swap partition.

It’s because this guy in this tutorial recommend to use swap file: https://averagelinuxuser.com/linux-swap/

Create a Swap file of 3G or whatever your RAM size is:

fallocate -l 3G /swapfile
language-noneCopy

Change its access rules, format and enable it:

chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
language-noneCopy

Also, add this Swap file to the /etc/fstab:

echo '/swapfile none swap sw 0 0' >> /etc/fstab
language-noneCopy

And check if the Swap file is working:

free -m
language-noneCopy

Install X window system and audio

pacman -S pulseaudio pulseaudio-alsa xorg xorg-xinit xorg-server
language-noneCopy

Enter to select all.

Install desktop environment

Install xorg:

sudo pacman -S xorg xorg-server
language-noneCopy

This is for mate.

sudo pacman -S mate mate-extra lightdm lightdm-gtk-greeter
language-noneCopy

But I preffer Xfce:

sudo pacman -S --needed xfce4 mousepad parole ristretto thunar-archive-plugin thunar-media-tags-plugin xfce4-battery-plugin xfce4-datetime-plugin xfce4-mount-plugin xfce4-netload-plugin xfce4-notifyd xfce4-pulseaudio-plugin xfce4-screensaver xfce4-taskmanager xfce4-wavelan-plugin xfce4-weather-plugin xfce4-whiskermenu-plugin xfce4-xkb-plugin file-roller network-manager-applet leafpad epdfview galculator lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings capitaine-cursors arc-gtk-theme xdg-user-dirs-gtk
language-noneCopy

Enable the lightDM service to start on boot.

sudo systemctl enable lightdm
language-noneCopy

Finally, reboot your ArchLinux system.

sudo reboot
language-noneCopy