Arch Linux

Preparation

1 - Go to the Arch Linux Download page and download the latest iso. Official Installation Guide

2 - Boot your PC from ArcLinux.

Check Internet Connection

ping -c 3 www.google.com

If you have an internet connection, skip "Networking for Installation"

ip link

ip link set interface up

Verify the boot mode

ls /sys/firmware/efi/efivars

Update System Time

timedatectl set-ntp true

timedatectl status

Parted or Gparted CD

pacman -Sy parted

lsblk

parted /dev/sda

Partition

(If EFI partition is already exists, skip EFI until mounting EFI to /mnt/boot)

mklabel gpt (Will Delete everything on the drive)

mkpart "EFI" fat32 1MiB 500MiB

set 1 esp on

mkpart "swap" linux-swap 500MiB 2.5GiB

mkpart "root" ext4 2.5GiB 52.5GiB

mkpart "home" ext4 52.5GiB 100%

quit


clear

fdisk -l (or parted -l or lsblk or blkid)

Encrypt home partition

(skip if you want to use ecryptfs later)

cryptsetup --type luks1 luksFormat /dev/sda4

cryptsetup open /dev/sda4 home


clear

lsblk

Format

(no /mapper if you will use ecryptfs)

mkfs.fat -F32 /dev/sda1

mkswap /dev/sda2

mkfs.ext4 /dev/sda3

mkfs.ext4 /dev/mapper/home

Mount

(no /mapper if you will use ecryptfs)

swapon /dev/sda2


mount /dev/sda3 /mnt


mkdir /mnt/boot

mount /dev/sda1 /mnt/boot


mkdir /mnt/home

mount /dev/mapper/home /mnt/home


lsblk

Crypt-Setup - Encryption Mounting at login

(skip if you want to use ecryptfs)

nano /etc/pam.d/system-login

add the line below

auth optional pam_exec.so expose_authtok /etc/pam_cryptsetup.sh


nano /etc/pam_cryptsetup.sh

add lines below

#!/usr/bin/env bash


CRYPT_USER="username"

PARTITION="/dev/sda4"

NAME="home-$CRYPT_USER"


if [[ "$PAM_USER" == "$CRYPT_USER" && ! -e "/dev/mapper/$NAME" ]]; then

/usr/bin/cryptsetup open "$PARTITION" "$NAME"

fi


chmod +x /etc/pam_cryptsetup.sh

nano /etc/pacman.d/mirrorlist

Alt+6 to copy a Server line, PageUp key to scroll up, Ctrl+U to paste it at the top of the list, Ctrl+K to delete the rest, Ctrl+O to save, Ctrl+X to exit

pacman -Syyu

or create your own list and paste it to /etc/pacman.d/mirrorlist

https://www.archlinux.org/mirrorlist/

SYSTEM

Base Packages

pacstrap /mnt base base-devel linux-hardened linux-firmware

Configure the system

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

less /mnt/etc/fstab

arch-chroot /mnt

hostnamectl set-hostname myhostname

ln -sf /usr/share/zoneinfo/America/Chicago /etc/localtime

hwclock --systohc --utc

pacman -Sy nano

nano /etc/locale.gen

locale-gen

echo LANG=en_US > /etc/locale.conf

Enable Network Manager

pacman -S networkmanager network-manager-applet polkit

systemctl enable NetworkManager

nano /etc/pacman.conf

Uncomment [core], [extra], [community] and [Multilib] for 32bit libraries

pacman -Sy

Initramfs

mkinitcpio -P

nano /etc/mkinitcpio.conf

add lines below (do not add encrypt if you use ecryptfs or no encryption)

MODULES=(ext4)

HOOKS=(base udev autodetect modconf block encrypt filesystems keyboard keymap fsck)


mkinitcpio -P

User

passwd

useradd -m -g users -G wheel,storage,power -s /bin/bash username

passwd username

Boot

pacman -S grub efibootmgr os-prober mtools

(skip if you use ecryptfs or no encryption)

--------------------------------------------

nano /etc/default/grub

uncomment

GRUB_ENABLE_CRYPTODISK=y

add the line below

GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda4:luks"

--------------------------------------------

grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub


grub-mkconfig -o /boot/grub/grub.cfg


exit

umount -R /mnt

reboot

OR

pacman -S refind

refind-install

When refind-install is run in chroot /boot/refind_linux.conf is populated with kernel options from the live system not the one on which it is installed. Edit /boot/refind_linux.conf and make sure the kernel parameters in it are correct for your system.

blkid

nano /boot/refind_linux.conf


exit

umount -R /mnt

reboot

auto update

mkdir /etc/pacman.d/hooks

nano /etc/pacman.d/hooks/refind.hook

Add lines below

[Trigger]

Operation=Upgrade

Type=Package

Target=refind


[Action]

Description = Updating rEFInd on ESP

When=PostTransaction

Exec=/usr/bin/refind-install

pacman -S xorg xorg-apps xorg-xinit

Graphics

gpasswd -a username video

lspci -v | grep -A1 -e VGA -e 3D

=Nvidia= Open Source drivers

pacman -S xf86-video-nouveau mesa

=AMD/ATI= Open Source driver

pacman -S xf86-video-ati mesa

=Intel= Open Source driver

pacman -S xf86-video-intel mesa

=Nvidia= Proprietary driver

pacman -S nvidia nvidia-utils

nvidia-xconfig

=AMD/ATI= Proprietary driver

pacman -S xf86-video-amdgpu mesa

Input Devices(Touchpad) and (Touchscreen)

pacman -S xf86-input-synaptics xf86-input-evdev

Desktop Environments

pacman -S xfce4 xfce4-goodies ligthdm lightdm-gtk-greeter

systemctl enable lightdm.service

Sound

pacman -S pulseaudio pavucontrol

Menu editor

alacarte

pacman -S mate mate-extra ligthdm lightdm-gtk-greeter

systemctl enable lightdm.service

pacman -S gnome gnome-extra gdm

systemctl enable gdm.service

Gnome-Terminal won't open; (Use xterm)

localectl set-locale LANG="en_US.UTF-8"

pacman -S vte3

Connect with Nautilus to a samba Server

pacman -S smbclient gnome-vfs gvfs-smb

To show the date in the top bar

gsettings set org.gnome.desktop.interface clock-show-date true

Turn on NumLock on login

gsettings set org.gnome.settings-daemon.peripherals.keyboard numlock-state on

Recommended Gnome Shell Extensions

to install go to https://extensions.gnome.org/

Dash to Dock

Lock Keys

TopIcon

eCryptfs

Ctrl+Alt+F2 , login as root

pacman -S cryptsetup ecryptfs-utils rsync lsof

modprobe ecryptfs

ecryptfs-migrate-home -u username

echo 'ecryptfs' > /etc/modules-load.d/ecryptfs.conf

logout of the root, do NOT restart

logging back into your main account (CTRL+Alt+F7)

ecryptfs-unwrap-passphrase

ecryptfs-mount-private


nano /etc/pam.d/system-auth

----------------------------------------

# add this line AFTER the line "auth required pam_unix.so" (or auth [default=die] pam_faillock.so authfail if present)

auth [success=1 default=ignore] pam_succeed_if.so service = systemd-user quiet

auth required pam_ecryptfs.so unwrap

# add this line ABOVE the line "password required pam_unix.so" (or -password [success=1 default=ignore] pam_systemd_home.so if present)

password optional pam_ecryptfs.so

# add this line AFTER the line "session required pam_unix.so"

session [success=1 default=ignore] pam_succeed_if.so service = systemd-user quiet

session optional pam_ecryptfs.so unwrap

----------------------------------------

reboot system

delete backup file in /home folder

rm -R username.RANDOM

System Extra

pacman -S bash-completion git gvfs gparted gpart ntfs-3g dosfstools mtools exfat-utils btrfs-progs jfsutils xfsprogs ttf-liberation gufw p7zip baobab

for user directories (remember to run "xdg-user-dirs-update" in your home folder later)

pacman -S xdg-user-dirs

Optional Software

pacman -S papirus-icon-theme file-roller evince gimp transmission-gtk audacity soundconverter python-google-api-core shotcut audacious vlc firefox

Network Time Protocol (do not use if you are dual booting with Windows)

pacman -S ntp

systemctl enable ntpd

pacman -S ffmpeg gstreamer faac flac libdca libdv libmad libmpeg2 libtheora libvorbis libxv wavpack x264 x265 xvidcore libheif

pacman -S libreoffice-fresh

pacman -S cups libcups cups-pdf system-config-printer

systemctl enable cups.service

gpasswd -a username optical

pacman -S libdvdread libdvdcss libdvdnav

apt-get install sudo

groupadd sudo

gpasswd -a username sudo

visudo /etc/sudoers

## Uncomment to allow members of group sudo to execute any command

%sudo ALL=(ALL) ALL

Manual Installation

(Need to install base-devel & make & git)

git clone https://aur.archlinux.org/packagename.git

cd packagename

makepkg -s

sudo pacman -U packagename.pkg.tar.zst

RUA

git clone https://aur.archlinux.org/rua.git

cd rua

makepkg -si

Software from AUR

rua install dropbox thunar-dropbox gtkhash

PACMAN

Update the System

pacman -Syu

Update the AUR packages

rua upgrade

Search

pacman -Ss package

Install

pacman -S package

pacman -U package (Local packages)

Remove

pacman -Rs package

pacman -Runs package

Clean Cache

pacman -Sc

pacman -Scc

rm -rf ~/.cache/*

Removing unused packages (orphans)

pacman -Qqtd

pacman -Runs $(pacman -Qqtd)

Remove DE safely

pacman -Runs gnome

Arch Info

pacman -S archey3

archey3

GUI Package Manager

pacman -S pcurses

pcurses

esc=cancel h=help ?=seacrh left/right arrows=add/remove c=clear !=execute q=quit