Skip to content

Instantly share code, notes, and snippets.

@hazel0177
Last active October 25, 2024 17:48
Show Gist options
  • Save hazel0177/566531c00a99b5fddc6a3e0c66d854b6 to your computer and use it in GitHub Desktop.
Save hazel0177/566531c00a99b5fddc6a3e0c66d854b6 to your computer and use it in GitHub Desktop.
Install Arch Linux on Legacy Bios Systems.

Part 1: Initial Steps

Before you can install Arch Linux, you need to get the ISO from the Arch Linux website. Once you have the ISO from your mirror of choice you should install Rufus (if you're on windows) and use that to copy the ISO to your USB drive. Then boot into the USB drive that you have just put the ISO's files onto (steps vary). Once you've booted in do these commands to ensure the rest will go smoothly.

loadkeys (your locale, google that.)
ping -c 3 google.com

Part 2: Packages, partitioning and Mirrors

Use lsblk to check the disk drive name, in this example it is /dev/sda (You may need to check as you may not use your main hard drive, or the USB is recognised as /dev/sda):

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0    7:0    0 474.1M  1 loop /run/archiso/sfs/airootfs
sda      8:0    0 931.5G  0 disk
├─sda1   8:1    0     8G  0 part
├─sda2   8:2    0   512M  0 part
└─sda3   8:3    0   923G  0 part
sdb      8:16   1  14.3G  0 disk
├─sdb1   8:17   1   586M  0 part /run/archiso/bootmnt
└─sdb2   8:18   1    64M  0 part

Once you know what your drive is called, use cfdisk /dev/(drive), replacing (drive) with sda,sdb etc. For the rest of the guide I'll be using sda. Press the del buttons on any partitions you wanna get rid of, i'll be getting rid of all of them.

For your SWAP partition, press new and set the partition size accordingly, I'll be using 8G. Then choose "primary". For your boot partition, press new and set the partition size to 512M, choose primary and toggle bootable on it. For your root partition, choose the size (i'll be using the rest of my HDD for this), and choose "primary" like how you have on both of your other partitions.

Once you have done all that, choose Write and type yes. Then choose quit. Activate the swap by doing:

mkswap /dev/sda1
swapon /dev/sda1

Then format the boot partition into vfat: mkfs.vfat /dev/sda2.

Finally, set the root partition into ext4: mkfs.ext4 /dev/sda3

Mounting your partitions

To mount the main partition do: mount /dev/sda3 /mnt Make the /home/ folder, mkdir /mnt/home

Mount the Boot Partition: mkdir /mnt/boot then mount /dev/sda2 /mnt/boot

To get your fastest mirrors go to: https://www.archlinux.org/mirrorlist/?country=(Your 2 letter country code) And do: mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak and then nano /etc/pacman.d/mirrorlist and copy the mirrors from that website into the file (replacing the # that is before the server=). It should look something like this:

##
## Arch Linux repository mirrorlist
## Generated on 2018-12-09
##

## United Kingdom
Server = http://mirror.bytemark.co.uk/archlinux/$repo/os/$arch
Server = https://mirror.bytemark.co.uk/archlinux/$repo/os/$arch
Server = http://mirrors.manchester.m247.com/arch-linux/$repo/os/$arch
Server = http://www.mirrorservice.org/sites/ftp.archlinux.org/$repo/os/$arch
Server = https://www.mirrorservice.org/sites/ftp.archlinux.org/$repo/os/$arch
Server = http://arch.serverspace.co.uk/arch/$repo/os/$arch
Server = http://archlinux.mirrors.uk2.net/$repo/os/$arch
Server = http://mirrors.ukfast.co.uk/sites/archlinux.org/$repo/os/$arch
Server = https://mirrors.ukfast.co.uk/sites/archlinux.org/$repo/os/$arch

Installing your base system.

Firstly, to install the main packages needed do: pacstrap -i /mnt base base-devel linux linux-firmware nano and hit enter for everything.

Then configure your fstab by doing:

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

Now you can log in to your sorta installed Arch Linux by doing: arch-chroot /mnt

Configuration.

To configure locale, use the following steps below, in /etc/locale.gen uncomment your locale.UTF-8 and replace en_GB.UTF-8 if you're not from the United Kingdom (like I am)

nano /etc/locale.gen
locale-gen
echo LANG=en_GB.UTF-8 > /etc/locale.conf
export LANG=en_GB.UTF-8

Now set your keymap, using the keymap you set at the start of the guide (replacing uk with whatever you used.)

echo "KEYMAP=uk" >> /etc/vconsole.conf

Now it's time to set your timezone, do

rm -rf /etc/localtime
ls /usr/share/zoneinfo/(your continent here)
ln -s /usr/share/zoneinfo/(your continent)/(nearest city listed) /etc/localtime
hwclock --systohc --utc

Now it's time to enable the multilib repository (needed for a lot of things). Edit your pacman config and uncomment [multilib] and Include = /etc/pacman.d/mirrorlist:

nano /etc/pacman.conf
pacman -Sy

Now edit your hosts file and set the hostname (replacing (pcname) with wahtever you wanna call it:

nano /etc/hosts
127.0.0.1 (pcname).localdomain (pcname)
echo "(pcname)" > /etc/hostname

Now to enable network connectivity list your network device by doing ifconfig do systemctl enable dhcpcd@<Your network link>.service Now set your root user password: passwd Now install sudo and bash completion: pacman -S sudo bash-completion

Completing the install

Now, create your user by doing: useradd -m -g users -G wheel,storage,power,log -s /bin/bash (your username) (replace (your username) with one you want) And give it a password: passwd (your username)

Now configure sudo by uncommenting "%wheel ALL=(ALL) NOPASSWD: ALL": EDITOR=nano visudo

Installing the bootloader

Just copy and paste these commands to install the bootloader.

mkinitcpio -p linux
pacman -S grub
grub-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg

(please note that if you're installing this on uefi you should use these instead:

mkinitpio -p linux
pacman -S efibootmgr grub
grub-install --target=x86_64-efi --efi-directory=/boot/efi /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg

Type: exit then umount -R /mnt then reboot. Once you've done that, remove your USB and now you have a working install of Arch Linux!

Post install

After logging in once you've rebooted, lets configure your install! Lets get some sound, do sudo pacman -S pulseaudio pulseaudio-alsa Now lets get xorg for GUI, do sudo pacman -S xorg xorg-xinit I'm gonna be installing GNOME, so to set it up do:

echo "exec gnome-session" > ~/.xinitrc
sudo pacman -S gnome gnome-extra
startx

Open your terminal and do:

sudo pacman -S git
git clone https://aur.archlinux.org/package-query.git
git clone https://aur.archlinux.org/yaourt.git
cd package-query/
makepkg -si
cd ..
cd yaourt
makepkg -si

Now yaourt is installed! To get a login manager installed:

sudo pacman -S lightdm
yaourt lightdm-slick-greeter
sudo nano /etc/lightdm/lightdm.conf

Now edit greeter-session in that config to show

greeter-session=lightdm-slick-greeter

Now save and exit and do sudo systemctl enable lightdm.service

Drivers

To get nvidia drivers do:

sudo pacman -S nvidia nvidia-utils lib32-nvidia-utils nvidia-settings
sudo nvidia-xconfig

Now you can reboot and fully enjoy Arch Linux!

@hazel0177
Copy link
Author

hazel0177 commented Jul 19, 2021

hi there, i added the stuff for if you're using efi, make /efi in the boot directory. i've also updated the pacstrap command.

felt weird logging into my old github to see this. uhh thanks for using this guide <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment