Install Arch Linux
the process of installing arch linux is quite hard, and overwhelming sometimes, if you are not familiar with the terminal and linux in general, but here we are going to break down the essential step to get going, to make a bare metal, functioning system:
keep in mind that this a generic guide, but you can make your changes, to suit your needs.
1. Prepare a USB Stick
download archlinux image from the here then, copy the image to usb device assuming it is sdb
:
dd if=archlinux-x86_64.iso of=/dev/sdb bs=1M
to get usb device path you need to run lsblk
and find your device finally reboot your system
2. Prepare Disk
after you booted into the arch installation media, you can move to the next step partitioning the disk, note that you should have internet connection in your machine, in order to fetch packages online. you need to know which device to install arch on, I will assume it is sda
.
fdisk /dev/sda
create new dos label on the disk. if you are using uefi system you should create efi partition, to verify you have uefi system, you should get output from the following command:
ls /sys/firmware/efi/efivars
500Mib would be enough, for efi partition and you should use fat32 on it.
mkfs.fat -F32 /dev/sda1
then create the root partition. and format it, you can use whatever filesystem you like, I chose btrfs.
mkfs.btrfs /dev/sda2
mount the partition
mkdir /mnt
mount /dev/sda2 /mnt
install base system
pacstrap /mnt linux linux-firmware base grub
chroot to the root fs:
arch-chroot /mnt
make the disk bootable on legacy bios system:
grub-install --targe=x86_64-pc /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
on uefi system: mount efi partition
mkdir -p /boot/efi
mount /dev/sda1 /boot/efi
install grub
grub-install --target=x86_64-efi --efi-directory=/boot/efi
grub-mkconfig -o /boot/grub/grub.cfg
3. Configuration
setup root account
passwd root
network config
echo "archlinux" > /etc/hostname
cat <EOF >>/etc/hosts
127.0.0.1 localhost
127.0.0.1 archlinux
EOF
install network manager
pacman -S networkmanager
systemctl enable NetworkManager
exit chroot environment
exit
generate fstab
genfstab -U >>/mnt/etc/fstab
reboot
umount -R /mnt
reboot
4. Create Unpriveleged Account
create user named stallman
, and add it to wheel group (doasers :) )
useradd -m -s /bin/bash stallman
grpadd wheel
usermod -aG wheel stallman
install doas, and allow wheel group members to run as root
pacman -S opendoas
cat <EOF >/etc/doas.config
permit persist :wheel
EOF
switch to the user account
su - stallman
5. Prepare The Graphical Environment
install xorg
doas pacman -S xorg-server xorg-xinit
install a compositor
doas pacman -S picom
install wallpaper manager
doas pacman -S nitrogen
install suckless utils
git clone https://git.suckless.org/dwm
git clone https://git.suckless.org/st
git clone https://git.suckless.org/dmenu
git clone https://git.suckless.org/slstatus
make -C dwm && doas make -C dwm install
make -C st && doas make -C st install
make -C dmenu && doas make -C dmenu install
make -C slstatus && doas make -C slstatus install
create xinitrc file
cat <EOF >.xinitrc
#!/bin/bash
nitrogen --restore &
picom -f &
slstatus &
exec dwm
EOF
finally get into the graphical environment
startx