-
🎷 @BobyMCbobsArch Linux Setup Guide
Here is my guide to installing my Arch Linux setup (with options)
Really, this is my process of installing Arch Linux. This process is equivalent to a guide, so here it is.
Make sure you find your way over to the Arch wiki -- in case you don't know it, it's a super useful wiki which is loaded with useful GNU/Linux information (not only Arch users use it).Prepare live USB
- Download ISO.
- Check ISO against given checksum from ArchLinux Download.
- Write to USB.
3.1 Locate ISO file (file will be referred to as ISO in command).
3.2 Locate USB devicefdisk -l(node will be referred to as DEVICE).
3.3dd if=ISO of=DEVICE status=progress.
Now that it's (hopefully) written correctly, this is the part where you boot into the live USB.
Launch a
bashshellCheck if system if UEFI compatible
ls /sys/firmware/efi/efivars
If this returns no errors and displays EFI variables, then your computer is UEFI compatible (keep note of this).Check internet connection
ping 8.8.8.8(you can use which ever server you want, of course)
If this returns successful ping responses, then the internet is connected and you can continue.Setup NZ mirrors for Arch Repo
- Move 'mirrorlist' to 'mirrorlist.old'.
mv /etc/pacman.d/mirrorlist{,.old}. - Get NZ Arch Linux repo list.
curl https://www.archlinux.org/mirrorlist/?country=NZ | tee -a /etc/pacman.d/mirrorlist - Get AU Arch Linux repo list.
curl https://www.archlinux.org/mirrorlist/?country=AU | tee -a /etc/pacman.d/mirrorlist - Edit commenting out of entries.
nano /etc/pacman.d/mirrorlist
Partitioning
- Display current partitions.
fdisk -l
Locate the drive which you intend to install Arch Linux on.
For SATA drives sd*
For NVMe drives nvme*
Whichever it is, I'll refer to it as DRIVE.- Setup partitions using cfdisk.
cfdisk /dev/DRIVE
Notes:
My usual layout is [ 200-500 MB Boot | 15-35 GB Root | * Home ].
- Select GPT.
- Create partitions.
- Commit changes.
- Format partitions.
3.1 Boot
mkfs.fat /dev/DRIVE1
3.2 Root
mkfs.ext4 /dev/DRIVE2
3.3 Home
mkfs.ext4 /dev/DRIVE3
Mount partitions
- Mount root.
mount /dev/DRIVE2 /mnt - Make boot directory in root.
mkdir /mnt/boot - Mount boot partition inside root.
mount /dev/DRIVE1 /mnt/boot
Install basesystem
pacstrap /mnt base base-devel
This will install Arch Linux to the mounted root partition.Now mount home parition to the Arch Linux install.
mount /dev/DRIVE3 /mnt/homeTo finish, generate the fstab.
genfstab -U /mnt >> /mnt/etc/fstabChroot time!
arch-chroot /mntSetup general system config
Generating correct locales
Edit uncomment en_US.UTF-8 UTF-8 locale.
nano /etc/locale.gen
Generate the correct locales.
locale-genSet language to English
echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8Set hardware clock
hwclock --systohc --utcSet hostname
echo "MYHOSTNAME" > /etc/hostnameSet localhost
echo "127.0.0.1 MYHOSTNAME.localdomain MYHOSTNAME" >> /etc/hostsSet local time
ln -sf /usr/share/zoneinfo/Pacific/Auckland /etc/localtimeChange root password
passwdBootloader
At this point the choice needs to be made between grub (UEFI or BIOS) and systemd-boot (UEFI only)
option a: grub
install grub components
pacman -Sy grub os-prober efibootmgrBIOS
grub-install --target=i386-pc /dev/sda --recheck --bootloader-id=archUEFI
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=arch --recheckChange grub timing (optional)
- Open defaults config:
nano /etc/default/grub - Change
GRUB_TIMEOUT=5toGRUB_TIMEOUT=1
Generate grub config (DON'T FORGET THIS)
grub-mkconfig -o /boot/grub/grub.cfgoption b (UEFI only): systemd-boot
bootctl installWrite an entry
cat > /boot/loader/entries/arch.conf << EOF title Archlinux linux /vmlinuz-linux initrd /initramfs-linux.img options root=$(blkid /dev/DRIVE2 -o export | grep ^PARTUUID | cut -d "=" -f2) EOFExit and cleanup chroot
exitor CTRL + D.Unmount partitions and reboot
umount /mnt/{boot,home,.}
rebootInside basesystem setup
Congratulations, you've made it this far!
You've just installed the basesystem (with minimal config), now let's set it up for use.Start networking.
dhcpcd
This may take a couple of seconds to initialise.Make (a) user(s)
useradd -mG wheel -s /bin/bash -d /home/USERNAME USERNAMEpasswd USERNAME
Allow wheel users to run sudo commands (learn the basics of vi/vim)
-
visudo. - Find line with '%wheel ALL=(ALL) ALL'.
- Remove '#'.
- Add line
Defaults pwfeedbackfor password entry feedback.
Install packages.
pacman -Sy net-tools networkmanager git bash-completion opensshEnable NetworkManager
systemctl enable NetworkManagerSetup a desktop environment
Setup xorg
pacman -S xorg-server xorg-apps xorg-xinit xorg-twm --neededGraphics driver
Nouveau:
pacman -S xf86-video-nouveau --needed
Nvidia:pacman -S nvidia-340xx nvidia-340xx-settings nvidia-340xx-utilsOptions, here's the choice between GNOME, KDE, and XFCE.
(Note: Of course, you can choose more than one, I just wouldn't recommend it)GNOME
pacman -S gnome gnome-software gdm
Start and enable GDM
systemctl start gdmKDE
pacman -S plasma kde-applications sddm
Start and enable SDDM
systemctl start sddmXFCE
pacman -S xfce4 lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings
Start and enable LightDM
systemctl start lightdmFinally
If the display manager works and you're able to login to your user
enablethe service inside a terminal or TTY; Otherwise, change TTYs and fix things.reboot!Post install stuff
Make nano the default text editor:
echo "export EDITOR=nano >> ~/.bash_profile"
Install a bunch of apps:sudo pacman -Sy virt-manager qtpass pass chromium thunderbird firefoxEdited by Caleb Woodbine
Please register or sign in to comment