Skip to content

Instantly share code, notes, and snippets.

@sortofsleepy
Last active October 17, 2024 03:08
Show Gist options
  • Save sortofsleepy/9e6b045e3e15b58a450519c683d1f936 to your computer and use it in GitHub Desktop.
Save sortofsleepy/9e6b045e3e15b58a450519c683d1f936 to your computer and use it in GitHub Desktop.
Arch installation notes

Notes on installing Arch

  • This is based on the offical wiki
  • This will install Arch, KDE and Grub.
  • This is just a minimal example with no real special customizations. The point is to remove some of the extra info the typical user likely won't need to worry about (yet)
  • This assumes you've alrady downloaded the Arch iso.
  • Some things may look a bit different for you; trying this on a Hyper-V virtual machine in Windows first.
  • Secure boot will need to be disabled during install. On Hyper-V I'm not sure what the right way is to re-enable but if you're doing an actual install, these are the provided notes

All in all, despite what you may have heard, installing Arch isn't actually that bad as long as you have a basic understanding of the terminal, there's just a lot of things to do to get a basic setup working which you should "hopefully" have at the end of this.

These directions should be working as of 10/13/2024.

First task is partitioning with FDisk...

FDisk

  • Probably the easiest thing to use since it's preinstalled on the iso. "Parted" also appears to be installed as well. I just went with fdisk since I'm somewhat familiar with it and all the options have simple(ish) explanations.

  • fdisk -l brings up the available disks on the system

  • fdisk <drive path> to run fdisk for the drive.

Making partition sizes

  • We're going to follow the recommended partition layout for UEFI found here
  • Select the command to add a new partition
  • You need to specify start and end sectors. Note that "sectors" are the unit of measurement (there is another called "cylinder" but it's marked as deprecated)
  • sectors can be specified in normal terms like "1mb" for megabytes
  • as you make partitions, fdisk should be helping you calculate where to begin the next partition.
  • Make sure to set each partition to the appropriate type(Fat32, EFI, etc)

When you're done

  • You should have the following

    • /dev/sda1 - boot (aka /dev/efi_system_partition)
    • /dev/sda2 - swap (aka /dev/swap_partition)
    • /dev/sda3 - main (aka /dev/root_partition)
  • Run mkfs.fat8 -F 32 to setup Fat32 filesystem on system partition

  • Run mkswap /dev/sda2 to setup the swap space with a filesystem.

  • Run mkfs.ext4 to setup root partition with Ext4 filesystem

Mount filesystems

  • Mount root partition to /mnt with mount /dev/sda3 /mnt
  • Mount boot to /mnt/boot with mount /dev/sda1 /mnt/boot --mkdir
  • enable the swap partition with swapon /dev/sda2

Package setup

  • Run pacstrap -K /mnt/base linux linux-firmware
  • Note you can append any additional packages you might need to the end of the command
  • You can install other packages if you forget by running pacman -S <package name>

Packages to set up

  • sof-firmware - this will get default audio working
  • kde-utilities-meta - should allow for Konsole(terminal access). There are apparently keybindings to switch between KDE gui/terminal mode too.

Timezone setup

  • Probably should do this before the next step cause command doesn't work in arch-chroot
  • timedatectl list-timezones - America/Los_Angeles is me
  • Use timedatectl set-timezone <zone> to set.
  • You may have to do this again after completing setup; first time I tried it didn't take until I did it again. (I think I ran hwclock later on which would reset things to UTC)

Configuration

  • generate fstab file by running genfstab -U /mnt >> /mnt/etc/fstab
  • root into the new system by running arch-chroot /mnt

Localization

  • Edit /etc/locale.gen and uncomment the locales to support. en_US is for american english
  • run locale-gen
  • create a locale.conf file at /etc/locale.conf with the value LANG=<locale name>, in our case en_US.UTF-8

Networking

Root

  • set the root password by running passwd

Bootloader

  • Root into main disk (arch-chroot /mnt after mounting your root partition to /mnt by running mount <partition> /mnt) and install grub and efibootmgr.
  • Mount boot drive (/dev/sda1) to /boot (mount /dev/sda1 /boot)
  • run grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB (remember to change target to correct procssor architecture but for the vast majority of people this should be correct)
  • Generate the main configuration file. by running grub-mkconfig -o /boot/grub/grub.cfg

Finishing up

  • Reboot
  • You should be presented with the Grub manager and an option to boot into Arch.
  • enable systemd-networkd and systemd-resolved systemctl enable <name>
  • To make sure settings take effect, may as well restart systemd-networkd

Make a new user

  • useradd -m <username>
  • passwd <username> to set a password
  • A home directory "should" be automatically created at /home/<username>. If not, you can manually create it.

GUI

  • Install a display manager. SDDM is recommended for KDE which we'll use for this example.
  • Install pacman -S sddm. Optionally install sddm-kcm which provides GUI options for settings and qt5-declarative for QT5 theme support. See https://wiki.archlinux.org/title/SDDM for more details.
  • Once thats installed, add a new configuration at /etc/sddm.conf.d/autologin.conf. The file should look something like
// from https://wiki.archlinux.org/title/SDDM#Autologin

[Autologin]
User=john
Session=plasma
@sortofsleepy
Copy link
Author

I've been thinking it's time to make Linux my main system and keep Windows on a separate drive for gaming / stuff that doesn't work super well on Linux. While I decide on a distro, I thought it'd be a good idea to go through a few of them using Window's Hyper-v before taking the plunge.

These are just some notes from my experience from installing Arch Linux. The wiki is EXTREMELY detailed, almost to a fault; it's not a bad thing but there's a of stuff that the typical person may not need so I thought it'd be a good idea to take notes.

Still need to make a few edits but for the most part, following this should get you a basic Arch install up and running.

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