How to Install Arch Linux
Here's how
Before Install
Back up EVERYTHING to something, like a usb hard drive/usb ssd thing. Use balena etcher or rufus to flash the arch linux installer onto a usb drive, NOT your back up medium. In fact you shouldn't have the medium you used to back up your system plugged in at all during the install.
Before Formatting
First, check if your system is a uefi system by entering cat /sys/firmware/efi/fw_platform_size
into the terminal. If it's either 32 or 64, you're using UEFI. If it doesn't exist, you're not. Enter ip link
to figure out if you have internet. It it says DOWN then follow the next steps. If you're using Wi-Fi enter iwctl device list
then iwctl --passphrase passphrase station name connect SSID
and replace passphrase with your wifi password, name with the device from device list and SSID with your WiFi name. Check if the network works by pinging a website, like this one, with ping paxtonpenguin.com
. Then enter timedatectl
to set the clock. You should be ready to format the hard drive.
Using fdisk
Use the command fdisk -l
to list the drives. You should see something like /dev/sda
or /dev/nvme0n1
, that's your hard drive/ssd that you can install onto. Then enter fdisk /dev/the_disk_to_be_partitioned
but replace the /dev/the_disk_to_be_partitioned with your disk. Now is where you deviate depending on if you have a bios or uefi system.
UEFI format
When you run fdisk press g to make the partition table GPT and then press n to make a new partition. Make a 1 gigabyte (by typing 1g) for the UEFI boot partition. Make another partition at least 4 gigs in space for a swap partition (basically more ram) and 1 final partition that uses the rest of the disc for actual space by just pressing enter when asked for a size. Press t to change the type of a partition. Use the EFI Partition type for the 1gb partition. Linux swap for the 4gb+ partition for swap. Linux x86_64 root (/) for the rest of the drive. Save the changes and exit with w.
BIOS format
When you run fdisk press m for an mbr partition or g for a gpt partition. It depends which one you want to use (both are fine, but gpt is easier). Press n for a new partition and press p if you are using mbr. Make a partition that's at least 4 gigabytes for swap (basically extra ram) by typing 4g and another one that takes up the entire rest of the drive by pressing enter when asked for the rest of the drive. Press t to change the type of the type of the partitions, Linux swap for the 4gig partition and Linux for the other partition. Save and exit by pressing w
The Format and Mounting
You could use other formats for the main drive (which if you're following this guide should be either /dev/whatever3 for uefi and /dev/whatever2 for bios, except don't actually use the word whatever in the commands), but ext4 is the default and best option. Type mkfs.ext4 /dev/root_partition
and replace root_partition with that partition that took up the test of the drive (/dev/whatever3 or /dev/whatever2). mkswap /dev/swap_partition
for the swap partition (i'm not making it pink in code parts). If you have a uefi partition, make the 1gb partition fat32 by doing mkfs.fat -F 32 /dev/efi_system_partition
and replace efi_system_partition with /dev/whatever1 or whatever the partition is. Mount the root partition with mount /dev/root_partition /mnt
and also replace the root_partition with whatever you replaced the other r_p with. Mount the uefi partition with mount --mkdir /dev/efi_system_partition /mnt/boot
and replace the e_s_p thing with the uefi partition. Finally add the swap with swapon /dev/swap_partition
and replace s_p with the actual partition.
Actually Installing
The last section sucked to write and now it's time to install Arch Linux by doing pacstrap -K /mnt base linux linux-firmware
and also adding some other stuff to that command like nano
for a easy to use text editor, because you'll need one. Also add dhcpcd to the command so you won't need to boot back into the installer again. Why yes i have done that before, it sucks. You also might need to add microcode for your cpu (amd-ucode and inter-ucode depending on your cpu), any firmware not in the linux-firmware
package (sof-firmware for onboard audio, linux-firmware-marvell for marvell internet packages, etc.), and iwd for wi-fi. Did i just add that to pimp up this section? Yes, but it's infomational.