User:Smekkleysa

From ArchWiki

This article is not officially supported.

The Arch Linux community does not offer support for the information contained in this page; for installation procedures, the Installation guide is the only officially supported document. The content below is mainly maintained by User:Smekkleysa, who last reviewed it on 18 April 2020, and it may be out of date or inaccurate.

Arch Linux Installation Guide aka Beginner's Guide

This is a page for quick overview for the Arch Linux installation on an intel machine with EFI.

Creating boot media

# dd bs=4M if=/path_of_archlinux.iso of=/dev/device_file_name status=progress oflag=sync

Installation

# Optionally start sshd and run installation command via ssh from another machine.
passwd
systemctl start sshd

# Partitioning (replace sda with your device file name)
parted -a opt /dev/sda
mklabel gpt
mkpart primary fat32 2MiB 262MiB
set 1 esp on
mkpart primary btrfs 262MiB 100%
quit

# Format (replace sda with your device file name)
mkfs.vfat /dev/sda1
mkfs.btrfs /dev/sda2

# Mount (replace sda with your device file name)
mount -o defaults,autodefrag,compress=zstd,discard,space_cache=v2,ssd,noatime /dev/sda2 /mnt
mkdir -p /mnt/boot
mount /dev/sda1 /mnt/boot

# Bring the closest repository to top.
vim /etc/pacman.d/mirrorlist

# Install base and vim
pacstrap -i /mnt base vim

# Write fstab. 
genfstab -U -p /mnt > /mnt/etc/fstab

# Change root to installation directory.
arch-chroot /mnt /bin/bash

# Locale (comment out your locale)
vim /etc/locale.gen
locale-gen
localectl set-locale LANG=en_US.UTF-8

# Timezone and ntp
timedatectl set-timezone Europe/Amsterdam
timedatectl set-local-rtc 0
timedatectl set-ntp true

# Add ntp server. 0.nl.pool.ntp.org 1.nl.pool.ntp.org
vim /etc/systemd/timesyncd.conf
systemctl enable systemd-timesyncd

# Hostname
hostnamectl set-hostname some-hostname

# Install Linux and etc
pacman -S linux intel-ucode

# Install bootloader
bootctl install

# Check PARTUUID for the root partition.
blkid

# Add boot entry (replace with PARTUUID from blkid)
cat > /boot/loader/entries/arch.conf <<EOF
title Arch Linux
linux /vmlinuz-linux
initrd /intel-ucode.img
initrd /initramfs-linux.img
options root=PARTUUID=replace_with_uuid rw intel_iommu=on
EOF

# Add default loader conf.
cat > /boot/loader/loader.conf <<EOF
default arch
timeout 1
EOF

# Root password
passwd


## Optional install and set up for desktop. (can be skipped) ##
# Dev packages and etc
pacman -S base-devel linux-firmware git sudo zsh
# Normal user in wheel group for sudo
useradd -m -s /bin/zsh -g wheel someuser
passwd someuser 
# Comment out %wheel
visudo
# Gnome 
pacman -S gnome-shell
# Gnome setting GUI
pacman -S gnome-control-center gnome-tweaks 
# For Gnome network setting GUI in case systemd-networkd isn't enough.
pacman -S networkmanager
systemctl enable NetworkManager
# GUI terminal
pacman -S gnome-terminal
# Automatic gnome start without dm
su - someuser
# Enable automatic start of Gnome (for zsh)
cat >~/.zprofile <<"EOF"
#!/bin/sh
if  [[  -z $DISPLAY && $(tty) == /dev/tty1 && $XDG_SESSION_TYPE == tty ]] ; then
    XMODIFIERS=@im=ibus QT_IM_MODULE=ibus GTK_IM_MODULE=ibus MOZ_ENABLE_WAYLAND=1 QT_QPA_PLATFORM=wayland XDG_SESSION_TYPE=wayland exec dbus-run-session gnome-session
fi
EOF
# AUR client
mkdir yay
cd yay
curl -L -o PKGBUILD 'https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=yay-bin' 
makepkg
pacman -U yay*.xz
# Google chrome
yay google-chrome
# logout from normal user
exit
####


# Exit chroot, unmount and reboot
exit
umount /mnt/boot
umount /mnt
reboot