Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

The Questionable Programmer's Guide to the Arch Linux Install

Ben Bistline edited this page Mar 10, 2022 · 6 revisions

On this page, you'll find my guide to installing Arch Linux. Although it uses a variety of resources, it primarily makes use of the ArchWiki Installation Guide, as seen here.

Without further ado, let's begin!

What do I Need?

  • x86_64-Compatible Machine with at least 512 MiB of RAM and at least 5 GiB of memory and an onboard ethernet port.
  • Bootable USB Stick with at least 1 GiB.

That's pretty much it. Some items, such as a keyboard and display, are needed but not explicitly stated.

Accquire an Installation Medium

  1. Go to the download website and click on a mirror (I recommend acm.wpi.edu).
  2. In that mirror, you will see a filesystem. Find and click on the file with the extension .iso. It should begin downloading once clicked.
  3. Download and install Rufus. This will allow us to prepare the USB.
  4. Launch Rufus and insert your USB. It should appear like this:

image

  1. Click "SELECT" and select the downloaded Arch ISO.
  2. Click "START" when ready to begin. This process could take up to 10 minutes.

Installation

Power Up!

  1. Plug the USB Stick into the computer.
  2. Enter the computer's boot while it boots. It is most likely the Option key on a Mac, and F12 on everything else. Look it up otherwise!
  3. Select an option similar to: "Boot from external medium".
  4. Select the first option presented by the USB Stick.

Check the Boot Mode

  1. A very important step is to check the boot mode. Run this command on the booted computer to check its mode: ls /sys/firmware/efi/efivars
  2. If this shows the directory without errors, then the system is booted in UEFI mode. Otherwise, the system may be booted in BIOS mode. Each mode will require slightly different steps.
+ UEFI steps will be green!
- BIOS steps will be red!

Disregard the +s and -s in the commands! Onwards!

Setup

  1. Plug in the Ethernet cable!
  2. Test the connection by running ping google.com. If it responds by saying that there was a failure in name resolution, you are not connected!
  3. Run fdisk -l to view the block devices.

You should now see an output of block devices. Note that one of them is the installation medium, and the other is the memory of the computer! Identify and make note of which is which.

For this guide, I will assume that /dev/sda is the computer's HDD. This means that /dev/sdb is my installation medium.

  1. Run the following commands (remember your color!):
+ cfdisk /dev/sda
+ Delete all partitions
+ Make a new primary partition with a size of 1 GiB. This will be the efi_partition. Change its type to EFI.
+ Make a new primary partition with a size of 1 GiB. This will be the swap_partition. Change its type to Linux swap / Solaris. 
+ Make a new primary partition with the remainder of the device. This will be the root_partition. Change its type to Linux (it might already be set to it). 

More experienced installers may look here:

image

- cfidsk /dev/sda
- Delete all partitions
- Make a new primary partition with a size of 1 GiB. This will be the swap_partition. Change its type to Linux swap / Solaris. 
- Make a new primary partition with the remainder of the device. This will be the root_partition. Change its type to Linux (it might already be set to it). Make this partition bootable as well!

More experienced installers may look here:

image

Exit cfdisk by clicking on Write, typing yes, and then clicking Quit.

Format the Partitions

Replace root_partition and swap_partition (and efi_partition if you have it) with their respective device IDs. For example, a BIOS system's swap_partition would most likely be /dev/sdaX, where X is 1.

  1. Run the following commands:
mkfs.ext4 /dev/root_partition
mkswap /dev/swap_partition
+ mkfs.fat -F 32 /dev/efi_partition
mount /dev/root_partition /mnt
+ mount /dev/efi_partition /mnt/boot
swapon /dev/swap_partition

Setup and More Installation

  1. Run the following commands:
pacman -Sy archlinux-keyring
+ pacstrap /mnt base linux linux-firmware sudo dhcpcd nano base-devel grub efibootmgr
- pacstrap /mnt base linux linux-firmware sudo dhcpcd nano base-devel grub
genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt
ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
hwclock --systohc
  1. Edit /etc/locale.gen by running: nano /etc/locale.gen.
  2. Find and uncomment the line that says en_US.UTF-8 UTF-8. Save and exit then.
  3. Run the following command: locale-gen.
  4. Create and edit /etc/locale.conf by running: nano /etc/locale.conf
  5. In this file, write: LANG=en_US.UTF-8. Save and exit then.
  6. Create and edit /etc/hostname by running: nano /etc/hostname
  7. In this file, write: coder. Save and exit then.
  8. Set the root password by running: passwd. Upon the prompt, enter the standard team password.

Install GRUB

Note that this section is really dependent on your boot system as well.

  1. Run your respective commands!:
+ mdkir /efi
+ mount /dev/efi_partition /efi
+ grub-install --target=x64_64-efi --efi-directory=/efi --bootloader-id=GRUB
- grub-install --target=i386-pc /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg

Reboot the System!

  1. Exit the chroot by running exit.
  2. As stated, reboot the system by running reboot now.
  3. Unplug the USB Stick as soon as the computer finishes turning off!

Additional Installation

At this point, Arch Linux is techincally installed. To really make good use of it however, we do need a few things, such as a desktop environment however!

Add a User

We are going to add our typical, non-root user.

  1. Enter the following commands:
useradd -m kryptoncougar
passwd kryptoncougar
  1. Enter the standard team password.
  2. Run: EDITOR=nano visudo and scroll down to the section labeled User privilege specification.
  3. Underneath root, type: kryptoncougar ALL=(ALL) ALL.
  4. Save and exit the file.

Desktop Environment Setup

  1. Run the following commands:
systemctl enable dhcpcd.service
systemctl start dhcpcd.service
pacman -Sy archlinux-keyring
pacman -S xorg plasma plasma-wayland-session kde-applications
systemctl enable sddm.service
systemctl enable NetworkManager.service
  1. Reboot the system with: reboot now.

Customization and Application Installation

Note that the majority of these steps may be skipped if you so choose. These are additional conveniences that many students deem standard on the team development computers.

Yakuake Setup

  1. Open the "System Settings" and search "autostart".
  2. Once found, click on the "+ Add" button at the bottom.
  3. Select "+ Add Application".
  4. Search and select "yakuake".
  5. Click "Ok".
  6. Close the settings.
  7. Launch Yakuake. Upon first launch, it will prompt you with the key you'd like to use to drop it. Choose either F12 or the eject key on a Mac.
  8. Feel free to play around with colors in Yakuake's settings!

Install Git and Get the Code

  1. Run the following commands:
mkdir ~/code
cd ~/code
sudo pacman -S git python3 python-pip
git clone https://github.com/FRC2539/pybot.git
cd pybot
pip3 install robotpy[all]
  1. Checkout to the current branch using: git checkout <branch_name>
  2. Try running the code with ./robot.py sim!

Install VSCode

  1. Launch Yakuake or another terminal.
  2. Run the following commands:
git clone https://aur.archlinux.org/visual-studi-code-bin.git
cd visual-studio-code-bin/
makepkg
sudo pacman -U visual-studio-code-bin-x.xx.x-x-x86_64.pkg.tar.zst
  1. And that's it! VSCode should be in the Development group of applications.

Install Chromium

  1. Run the following command: sudo pacman -S chromium
  2. Chromium should now be installed. Check in the internet group of applications.

Change Desktop Startup Screen

  1. Launch "System Settings".
  2. Click on "Startup and Shutdown".
  3. Select "Breeze", or some other display.
  4. Click Apply and enter the root password.
  5. Close the settings.
  6. Reboot the computer with sudo reboot now.

Add Applications to the Desktop and Taskbar

  1. Being by removing everything from both the taskbar and the desktop.
  2. Open the application menu and find Chromium.
  3. Right-click on it and add it to the Desktop.
  4. Right-click on it again and add it to favorites.
  5. Right-click on it once more and add it to Task Manager.
  6. Repeat this process for VSCode.
  7. Change the Desktop icon size to "Large" by right-clicking on the desktop and selecting the "Icons" option.

WiFi Card Drivers

Note that this process is very unique to your computer. I will do this process for the computer I am using.

  1. Run lspci and find your network controller.
  2. Once found, search for that controller's Linux driver on the internet.
  3. I need the b43-firmware, which is on the AUR.
  4. I am going to run: git clone https://aur.archlinux.org/b43-firmware.git.
  5. Once downloaded. I will enter the directory and make the package using makepkg.
  6. Finally, I can install it with the package manager by running sudo pacman -U b43-firmware-x.xx.xxx.xx-1-any.pkg.tar.zst.
  7. Reboot the computer with sudo reboot now.

Add Custom GRUB Image

  1. Get the photo and put it in a good spot (format should be PNG or JPEG).
  2. Edit /etc/default/grub with nano and uncomment the GRUB_BACKGROUND line.
  3. Set the value in the string equal to the path of the image.
  4. Re-generate the config for the changes to take effect. To do this, run sudo grub-mkconfig -o /boot/grub/grub.cfg.
  5. Reboot the computer with sudo reboot now.

Problems?

My Display Manager Isn't Showing Any Users!

  1. Hit Ctrl + Alt + F1 to enter a terminal when on the SDDM screen.
  2. Enter: systemctl enable sddm.service
  3. Did you make the kryptoncougar user? Try creating it again. See the "AddUser" section.
  4. Reboot with reboot now.

makepkg Keeps Failing, and I Don't Know Why!

  1. Try installing the base-devel package.
  2. Run: sudo pacman -S base-devel.
  3. Try it again!