Skip to content

Latest commit

 

History

History
477 lines (327 loc) · 11.1 KB

File metadata and controls

477 lines (327 loc) · 11.1 KB
category Guide
title Installation guide
type GUIDE

BGameiro's Installation Guide of ArchLinux with my dotfiles

This file exists because I always forget that my Boot/Efi partition can't be formatted with the EXT4 file system. I also forget how I configured things last time.

So if you have any problem replicating my system, just made the change for Linux and want one more source of information or are my future self: feel free to follow this installation and configuration guide based on the official installation from the Arch Wiki.



Assumptions

  • Correct ISO
  • UEFI mode
  • Have an internet connection
  • Use FAT32 for the Boot partition and EXT4 for the others
  • x86_64 system


Installation

  1. Pre-installation
    1. Prepare the live environment
    2. Boot the live environment
    3. Set the keyboard layout
    4. Update the system clock
    5. Partition the disks
    6. Format the partitions
    7. Name the partiotions
    8. Mounts the file systems
  2. Installation
    1. Install the base and base-devel package
  3. Basic configuration
    1. Fstab
    2. Chroot
    3. Time zone
    4. Localization
    5. Network configuration
    6. Initramfs
    7. Root password
    8. Boot loader

Configuration

  1. Create a new user
    1. Download your shell
    2. Create the user
    3. Set the password
    4. Create the Wheel group
  2. Install Xorg
  3. Install the graphics drivers
  4. Install the display manager
    1. Install the LightDM
    2. Enable it
    3. Download and add numlockx
    4. Select the correct greeter
  5. Install the Window Manager
  6. Install packages
  7. Set configurations according to my dotfiles


Installation

Pre-installation

Prepare the live environment

Go to archlinux.org/download and download the latest .iso.

It is recommended that you download using Torrent due to the possibility of having a corrupt file. If you use direct download it is recommended that you verify the checksums by running the commands:

md5sum archlinux-version-x86_64.iso

sha256sum archlinux-version-x86_64.iso

You can also verify the integraty of your .iso once you boot it by running:

gpg --keyserver-options auto-key-retreive --verify archlinux-version-x86_64.iso.sig

Next burn the .iso to your flash drive. There are several ways of doing this, I use Etcher since it's free and cross-platform.

Finally access your computer BIOS and make sure that USB live appears first in the boot order that any other bootable media that you may have installed.

Boot the live environment

When it comes to the bootloader select Boot Arch Menu. It will boot your live environment and you will be automatically logged as root in a zsh shell.

Set the keyboard layout

Default keyboard layout is US.

Available layouts can be listed with:

ls /usr/share/kbd/keymaps/**/*.map.gz

To select a keyboard layout run:

loadkeys layout

Example for portuguese layout:

loadkeys pt-latin9

This only changes the layout for the live environment until the next boot.

Update the system clock

Just run:

timedatectl set-ntp true

Partition the disks

This is probably where most systems differ.

I have 4 SSDs in my computer. One 120 Gb SSD with my EFI and root partitions, one 240 Gb SSD with my home partition, one 240 Gb SSD with my music directory and one 500 Gb SSD with my game directory. I don't have swap as I have plenty of RAM and I don't put my computer to hibernate or in suspension.

You will need 2 basic partitions: EFI and root.

Once you have one idea of what your partitions may look like you can run the following command to list your partitions:

fdisk -l

To create the partitions you can use cfdisk as it's more intuitive:

cfdisk /dev/sdX

Where X is the letter of your disk (see fdisk -l).

Wipe all partitions and create the ones you want.

You need an EFI partition with at least 512 Mb and a root partition.

This is what my configuration looks like:

Format the partitions

Now that you have the partitions you have to format them. You can use the following commands (where X is letter of a disk and Y is the number of your partition) for each of your partition:

Swap:

mkswap /dev/sdXY
swapon /dev/sdXY

EFI partition:

mkfs.fat -F 32 /dev/sdXY

Any other partition:

mkfs.ext4 /dev/sdXY

Name the partitions

To make everything more easier lets name our partitions by giving them labels:

Swap:

swaplabel -L "new label" /dev/sdXY

Fat32:

fatlabel /dev/sdXY "new label"

Ext4:

e2label /dev/sdXY "new label"

Mount the file systems

You now have to mount the partitions on the root partition /mnt:

EFI partition:

mount /dev/sdXY /mnt/efi

Root partition:

mount /dev/sdXY /mnt

Home partition:

mount /dev/sdXY /mnt/home

If you created a partition for a specific user, for games or for music don't mount it yet.

Installation

Install the base

You may want to update you mirrors before this. But I don't. You can run this script to update and rank them.

Now comes the part when you install the basic packages for your system. The only required package is base but I recommend installing the base-devel package. Run:

pacstrap /mnt base base-devel

You can install more packages besides base and base-devel. For example, you can install the zen kernel with:

pacstrap /mnt base base-devel linux-zen linux-zen-headers linux-zen-docs --ignore linux linux-headers linux-docs

For a list of available kernels please refer here.

I recommend installing linux-zen for desktop/laptop use (and gaming), linux-hardened for server, nas or anything that may be exposed to the network. For any other purpose, or if you don't want to mess with the kernel, just stick to the vanilla kernel as most differrences are unnoticeable.

You only need to install the base package and base-devel if you're using AUR.

You can install any official package with pacstrap but this is not recommended.

Basic configuration

Fstab

First lets geneate the fstab file. The fstab file is a file that contains the information about mounted drives and partitions. You can configure the file based on UUID (with the -U flag) or baseed on labels (with the -L flag). To generate the file run:

genfstab -L /mnt >> /mnt/etc/fstab

You have to run this command (genfstab -L / >> /etc/fstab if already in your system) after adding another mounted drive to your system in order to be persistent after boot.

You can then check the file (/mnt/ect/fstab) in order to see if there is any error.

Chroot

Now change root into your system by running:

arch-chroot /mnt

This means that you are now under your system (previously /mnt) instead of the live system.

Time zone

The time zone can be set with:

ln -sf /usr/share/zoneinfo/Region/City /etc/localtime

For example, for Lisbon, Portugal:

ln -sf /usr/share/zoneinfo/Europe/Lisbon /etc/localtime

Now to generate /etc/adjtime:

hwclock --systohc

This command assumes the hardware clock is set to UTC.

Localization

To set the locales you need to uncomment the needed loacles in /etc/locale.gen. You can do this with:

nano /etc/locale.gen

and erasing the '#' before the desired locales. In my case it would look something like this:

#aa_DJ.UTF-8 UTF-8
#aa_DJ.UTF-8 UTF-8
...
#en_SG ISO-8859-1
en_US.UTF-8 UTF-8
#en_US. ISO-8859-1
...
#pt_BR ISO-8859-1
pt_PT.UTF-8 UTF-8
#pt_PT ISO-8859-1
...
#zu_ZA.UTF-8 UTF-8
#zu_ZA ISO-8859-1

Then run:

locale-gen

To set the variables according to your locales you need to edit at least the LANG variable in /etc/locale.conf. Once again, you can do this with:

nano /etc/locale.conf

and it should at least look like this:

LANG=en_US.UTF-8

More complex files can look, for example, like this:

LANG=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_TIME=pt_PT.UTF-8
LC_MEASUREMENT=pt_PT.UTF-8
LC_ADDRESS=pt_PT.UTF-8
LC_TELEPHONE=pt_PT.UTF-8
LC_MONETARY=pt_PT.UTF-8
LC_NUMERIC=pt_PT.UTF-8
LC_PAPER=pt_PT.UTF-8

To make your keyboard layout persistent edit /etc/vconsole.conf with:

nano /etc/vconsole.conf

To look like this:

KEYMAP=pt-latin9

This change won't do anything in graphical environments. This only applies to the TTY. (Not even terminal emulators)

Network configuration

Create the hostname (name of your host) file:

nano /etc/hostname

with the name of your host:

myhostname

and match the entries to hosts:

nano /etc/hosts
127.0.0.1   localhost
::1         localhost
127.0.1.1   myhostname.localdomain   myhostname

A permanent IP address should replace 127.0.1.1 in case there is one configured.

Initramfs

Usually this is not required since mkinitcpio was run on installation of linux with pacstrap.

If you have a custom system (RAID, LVM, ...), modify mkinitcpio.conf and run:

mkinitcpio -p linux

Root password

To set the root password run:

passwd

Boot loader

There are several boot loaders. This guide uses systemd-boot since it's already installed.

To install run:

bootctl --path=/boot install

To configure you have to create/edit /boot/loader/loader.conf and then add the entries necessary.

First:

nano /boot/loader/loader.conf
default         arch
timeout         0
console-mode    max

And finally:

nano /boot/loader/entries/arch.conf
title   Arch Linux
linux   /vmlinuz-linux
initrd  /intel-ucode.img
initrd  /initramfs-linux.img
options root=LABEL=YourRootLabel rw quiet loglevel=3 vga=current

Configuration

Create a new user

Download your shell

Create the user

Set the password

Create the Wheel group

Install Xorg

Install the graphics drivers

Install the display manager

Install the LightDM

Enable it

Download and add numlockx

Select the correct greeter

Install the Window Manager

Install packages

Set configurations according to my dotfiles