This guide provides step-by-step instructions on how to install Arch Linux alongside Windows, using GRUB as the bootloader and a desktop environment.
If there is no Ethernet connection available, use the Wi-Fi instead.
# to manage wireless connections in Linux, use `iwctl` to enter the iwctl mode.
iwctl
# show device:
device list
# show network: (wlan0 is my device)
station wlan0 get-networks
# connect:
station wlan0 connect MyWifiNetwork
(only on single boot)
# enter gdisk mode
gdisk /dev/nvme0ne
# enter expert mode
x
# Erase the drive
z
# set password to use ssh:
passwd
# check ip address:
ip -c a
Update time date:
timedatectl set-timezone America/New_York
timedatectl status
# Check all drive:
lsblk
# Check more information:
fdisk -l
# Create partition: (nvme0n1 is my drive)
cfdisk /dev/nvme0n1
swap is optional
Partition | Size | Type |
---|---|---|
Boot | 1G | EFI System |
Root | Remaining Space | Linux filesystem |
Swap | 4-8G | Linux swap |
after creating the disk, press write and quit
# Format Boot partition
mkfs.fat -F 32 /dev/nvme0n1p6
# Format Root partition:
mkfs.ext4 /dev/nvme0n1p7
# Format Swap partition:
mkswap /dev/nvme0n1p8
# Enable Swap partition:
swapon /dev/nvme0n1p8
# Mount Root Partition:
mount /dev/nvme0n1p6 /mnt
# Create Dir:
mkdir /mnt/home
# Mount the home partition to this Dir:
mount /dev/nvme0n1p7 /mnt/home
sudo nmcli dev wifi connect MY_WIFI password "MY_PASSWORD"
# Backup best mirrors list:
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
# backup location
cat /etc/pacman.d/mirrorlist.bak
# Update Pacman database:
pacman -Sy
# Install packman rank mirrors tool:
pacman -S pacman-contrib
# Save top 10 mirrors list:
rankmirrors -n 10 /etc/pacman.d/mirrorlist.bak /etc/pacman.d/mirrorlist
# Top 10 servers:
cat /etc/pacman.d/mirrorlist
# install system packages (add linux-lts for lts version)
pacstrap -i /mnt base base-devel linux linux-headers linux-firmware intel-ucode sudo nano vim git neofetch networkmanager dhcpcd pulseaudio wpa_supplicant
# Generate File System Table FSTAB:
genfstab -U /mnt >> /mnt/etc/fstab
# See all partitions and their mounting points:
cat /mnt/etc/fstab
# Enter into the arch linux drive:
arch-chroot /mnt
# Set root password:
passwd
# create user:
useradd -m maxime
# add password to maxime user
passwd maxime
# Add user to wheel group, allow to access root privileges:
usermod -aG wheel,storage,power maxime
# Edit sudo config file:
visudo
# Uncomment the first line to allow wheel group to run sudo command
# Add second line to repromp user to enter password for sudo after a timestamp
# Uncomment local: (en_US.UTF-8 UTF-8)
vim /etc/locale.gen
# Generate a locale:
locale-gen
# Create a conf file:
echo LANG=en_US.UTF-8 > /etc/locale.conf
# Set System language:
export LANG=en_US.UTF-8
# Sync Local time with region:
ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
# Set hostname:
echo ArchLinuxMaxime > /etc/hostname
# Read hostname
cat /etc/hostname
# Add hosts:
vim /etc/hosts
# Install into EFI partition:
mkdir /boot/efi
mount /dev/nvme0n1p1 /boot/efi
# Install grub:
pacman -S grub efibootmgr dosfstools mtools
# Uncomment this last line:
vim /etc/default/grub
# config for dual boot
pacman -S os-prober
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub_uefi --recheck
grub-mkconfig -o /boot/grub/grub.cfg
# Enable Network services:
systemctl enable dhcpcd.service
systemctl enable NetworkManager.service
# Unmount all partitions:
umount -lR /mnt
# Reboot and eject usb boot:
reboot
sudo pacman -S xorg xorg-xinit xterm plasma plasma-desktop kde-applications kdeplasma-addons sddm
# Create config file to start kde on boot
sudo vim ~/.xinitrc
# Add these lines
export DESKTOP_SESSION=plasma
exec startplasma-x11
# Enable Display Manager:
sudo systemctl enable sddm.service
reboot
sudo pacman -S xorg xorg-xinit xterm gnome gnome-extra gnome-shell gnome-tweaks gdm
# Create config file to start kde on boot
sudo vim ~/.xinitrc
# Add these lines
export XDG_SESSION_TYPE=x11
export GDK_BACKEND=x11
exec gnome-session
# Enable Display Manager:
sudo systemctl enable gdm.service
reboot
# find what card and drivers im using
lspci -k | grep -A 2 -E "(VGA|3D)"
# Install Nvidia driver
sudo pacman -S nvidia
# remove kms from hooks to prevent nouveau driver to start on boot
sudo vim /etc/mkinitcpio.conf
sudo reboot
# make sure nvidia driver are being used
lspci -k | grep -A 2 -E "(VGA|3D)"
# give execute permission
sudo chmod +x install_packages.sh
./install_packages.sh