Difference between revisions of "User:A2WXH3i"

From ArchWiki
Jump to navigation Jump to search
Line 31: Line 31:
Below is an example of how you can use {{ic|dd}} to copy the is to a USB.
Below is an example of how you can use {{ic|dd}} to copy the is to a USB.
  # sudo dd if=archlinux-'version'-x86_64.iso of=/dev/sd'X' status=progress
  # sudo dd if=archlinux-''version''-x86_64.iso of=/dev/sd''X'' status=progress
Once the ISO is copied to the USB boot to it.
Once the ISO is copied to the USB boot to it.

Revision as of 21:43, 18 June 2019

Warning: This is a collection of unofficial Arch Linux installation guides written by myself.

This guide assumes basic knowledge of how to use GNU/Linux, the folder structure of a GNU/Linux system and how to use VIM or nano to edit text files.

Text in italics means you should replace the text with something appropriate to your install.

Unofficial Arch Linux Installation Guide

Prerequisites (Pre-boot)

Note: Regardless of the installation you will be attempting these steps need to be followed.

Download Arch Linux.

Verify ISO

Note: These next steps require either a system with GnuPG installed or an Arch Linux derivative e.g. Manjaro Linux.

Download the PGP signature and verify the ISO.

$ gpg --keyserver pgp.mit.edu --keyserver-options auto-key-retrieve --verify archlinux-version-x86_64.iso.sig

The following command can be used if using an Arch Linux derivative:

$ pacman-key -v archlinux-version-x86_64.iso.sig

Copy media to a USB

You can use the tool dd to copy the ISO to the USB via the command line, alternatively you could use Etcher if you like a GUI.

Below is an example of how you can use dd to copy the is to a USB.

# sudo dd if=archlinux-version-x86_64.iso of=/dev/sdX status=progress

Once the ISO is copied to the USB boot to it.

Prerequisites (Live USB)

Note: Use Shift+PageUp and Shift+PageDown to scroll in the TTY.

Keyboard Layout

If you need a keyboard layout that isn't US English use the command below to list possible keymaps.

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

Set the keymap.

# loadkeys uk

Verifying boot mode

# ls /sys/firmware/efi/efivars
Warning: If nothing is listed here, you are NOT in EFI mode.

Connecting to the internet

If using Wi-Fi use the command below.

# wifi-menu

If you are on a wired connection you should connect to the network automatically, if you don't use the command below.

# dhcpcd

Verifying internet connection.

# ping archlinux.org

Changing Mirrors

On another device visit the link below and generate mirror links for your country.


Once you have generated mirrors edit the file shown below.


Sync the newly added mirrors.

# pacman -Syyy

Syncing the clock

Use the command below which will use systemd's Network Time Protocol service to sync the clock with a server.

# timedatectl set-ntp true

Verify the clock synced.

# timedatectl status

Standard UEFI Install

Partition the disk

Warning: The first thing to do is to list the disks in your system, you could have an NVME drive in your PC which could effect this guide. This guide will be using /dev/sdX. If you are using NVME it should be /dev/nvme0n1. Please make sure you are targeting the correct drive as loss of data will occur.

Use the command below to list the disks in your system.

# fdisk -l

Target the disk you will be using for installation.

# fdisk /dev/sdX

EFI Partition

Use g to create a GUID partition table as opposed to a Master boot record.


Use n to create a new partition.


Skip the partition number.


Skip the first sector resizing.


Next make the size of the partition 512MB big, this will be used for UEFI.


Use t to change the type of the partition.


This will select the partition number, you could just press enter.


This will set the partition to EFI.


Root Partition

Now create the root partition where Arch Linux will be installed.


Keep this partition as number 2.


Skip the first sector resizing.


Skip second sector resizing so the rest of the disk is used.


Finally write all these changes to the disk.

Note: You should check the partition layout with p before writing the changes.

Example Layout

Your drive should look like something below.

Mount point Partition Type Size
/mnt/boot /dev/sdX1 EFI (FAT32) 512M
/mnt /dev/sdX2 Linux FS (ext4) 120G

Format partitions

Format the EFI partition.

# mkfs.fat -F32 /dev/sdX1

Format root partition.

# mkfs.ext4 /dev/sdX2

Mount partitions

Next mount the partitions so you can install Arch Linux.

# mount /dev/sdX2 /mnt

Make a directory before mounting the boot partition otherwise it will fail.

# mkdir /mtn/boot

Now mount the boot partition.

# mount /dev/sdX1 /mnt/boot

Install the base system

Next install the base system along with base-devel and the linux-headers package.

Note: You can add more packages here if you would like.
# pacstrap -i /mnt base base-devel linux-headers

Generate fstab file

Generate a fstab file so Arch Linux knows how to boot properly.

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

Chroot into the system

This will transfer you from the live USB to your new Arch Linux install.

# arch-chroot /mnt

Install packages

Note: Microcode packages should be installed for your CPU.

The Intel package is intel-ucode

The AMD package is amd-ucode
# pacman -S grub efibootmgr dosfstools os-prober mtools vim bash-completion

Configuring GRUB

Mount EFI partition

Create the folder below as the partition won't mount.

# mkdir /boot/EFI

Now mount the partition.

# mount /dev/sdX1 /boot/EFI

Install GRUB

Warning: The --efi-directory flag is crucial as GRUB will fail to install.
Note: The --bootloader-id flag can also be changed to your liking.
# grub-install --target=x86_64-efi --efi-directory=/boot/EFI --bootloader-id=Arch_Linux --recheck

English locale file

Copy english locale file for grub.

# cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo

Generating GRUB config file

You need to generate a config file for GRUB so the system boots.

Note: The microcode packages installed earlier will be included in this config.
# grub-mkconfig -o /boot/grub/grub.cfg

Standard UEFI Finished

Tip: It is recommend you follow the post-installation guide for a more complete system.


Create swap file

Tip: It is better to create a swap file rather than a swap partition because they are easier to manage.

This will create a file which is 4GB in size that is located in the root of our install.

# fallocate -l 4G /swapfile

Next set it so only root can manipulate the file.

# chmod 600 /swapfile

This makes the file a swapfile.

# mkswap /swapfile

Then add it to the fstab so it loads when we boot into our system.

# echo '/swapfile none swap sw 0 0' | tee -a /etc/fstab`

Set the locale

Uncomment en_US.UTF-8 UTF-8 and any other needed locales e.g. en_GB.UTF-8 UTF-8


Generate the locales.

# locale-gen

Next edit /etc/locale.conf so it looks like something below.


Next do the same for /etc/vconsole.conf so you get the preferred keyboard layout in the TTY.


Set the time zone

Use the command below which will use systemd's Network Time Protocol service to sync the clock with a server.

# timedatectl set-ntp true

Verify the clock synced.

# timedatectl status

Make a link with your timezone so the clock can adjust accordingly.

# ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime

Lastly set the hardware clock from the system clock.

# hwclock --systohc`

Set the hostname

Add your desired hostname


User management

Set the root password.

# passwd

This will create a user and it will also create a directory for them in /home.

# useradd -m user

Set the password for the new user.

# passwd user

User privileges

You should only use visudo on this file, editing this with another editor may make sudo unuseable.

# /etc/sudoers

Enabling multilib repositories

You will need to edit /etc/pacman.conf and uncomment the multilib section.

Include = /etc/pacman.d/mirrorlist