Thursday | 10 OCT 2024
[ previous ]
[ next ]

Installing Arch Linux - Laptop

Title:
Date: 2024-02-06
Tags:  

Get the installation iso:

wget https://geo.mirror.pkgbuild.com/iso/2024.02.01/archlinux-x86_64.iso

Copy it to the device:

cp archlinux-x86_64.iso /dev/disk/by-id/usb-SanDisk_Cruzer_Glide_03003410121123160926-0:0

Boot up the laptop with the USB and get into arch.

Use iwctl to connect to a wifi network:

iwctl
station wlan0 scan
station wlan0 get-networks
station wlan0 connect "network name"

Once the network is up, format the drive using cfdisk:

cfdisk nvme0n1

Delete all the mappings and create new ones.

1G EFI System
4G Linux Swap
Rest Linux root (x86-64)

Make the filesystems:

mkfs.fat -F 32 /dev/nvme0n1p1
mkswap /dev/nvme0n1p2
mkfs.ext4 /dev/nvme0n1p3

Mount the system:

mount /dev/nvme0n1p3 /mnt
mount --mkdir /dev/nvme0n1p1 /mnt/boot
swapon /dev/nvme0n1p2

Install arch:

pacstrap -K /mnt base linux linux-firmware

Generate the fstab:

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

Chroot in:

arch-chroot /mnt

Some stuff to install

efibootmgr
grub
vim
openssh
networkmanager
base-devel
linux-headers
git
rust
sudo

Create a new user:

useradd -m -G wheel -s /bin/bash username

Some configuration:

ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
hwclock --systohc

Update /etc/locale.gen
locale-gen

Update /etc/locale.conf
LANG=en_US.UTF-8

Install networkmanager:

pacman -Sy networkmanager

Now set up the boot loader:

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

Finally set a root password:

passwd

Exit the chroot environment and shutdown:

shutdown -h now

Now when you start up again, you should be booted into Arch.