Skip to content

Instantly share code, notes, and snippets.

@svenikea
Last active February 15, 2023 04:02
Show Gist options
  • Save svenikea/44c1115d4e3671fb9746d046d7246047 to your computer and use it in GitHub Desktop.
Save svenikea/44c1115d4e3671fb9746d046d7246047 to your computer and use it in GitHub Desktop.
Arch Linux Installation guide

Arch Linux Installation guide

Update the system clock

timedatectl set-ntp true

To check the service status, use timedatectl status

Optional

timedatectl set-timezone America/Los_Angeles

To manually set timezone

  • If you don't know which one is near you issue this command
timedatectl list-timezones
  • Or you know your location then type this command to find your location

timedatectl list-timezones | grep <name>

Partition the disks

cfdisk
fdisk -l

for checking list disk

Format the partitions

For home and base system

mkfs.ext4 /dev/sdX1

For swap partition

mkswap /dev/sdX2 

Mounting the file systems

For root partition

mount /dev/sdX1 /mnt 

For home partition

mount /dev/sdX2 /mnt/home

For EFI Scheme, make sure directory /boot/efi is created then mount it

mount /dev/sdX3 /mnt/boot/efi

Installation

Select mirrors

vim /etc/pacman.d/mirrorlist

On Manjaro linux when installing Arch on USB or ext. HDD

sudo pacman-mirrors -g

choose your closet mirrors

Install essential packages

pacstrap /mnt base base-devel linux linux-firmware ntfs-3g sudo vim grub os-prober netctl dialog wpa_supplicant dhcpcd ppp

Configure the system

Fstab

Generate an fstab file use -U

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

Edit the sudoers file

Enable user in the wheel group to have sudo access by uncommenting this line # %wheel ALL=(ALL) ALL

Export vim as editor

ln -s /usr/bin/vim /usr/bin/vi

Chroot

Change root into the new system

arch-chroot /mnt

Time zone

Set the time zone*

ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime

Run hwclock to generate /etc/localtime

hwclock --systohc

Localization

Uncomment en_US-UTF-8 YTF-8 in /etc/locale.gen, and generate them with:

locale-gen

Create the locale.conf file, and set the LANG variable accordingly:

/etc/locale.conf
LANG=en_US.UTF-8

Network configuration

Create the hostname file:

/etc/hostname
myhostname

Add matching entries to hosts(5):

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

Initramfs

mkinitcpio -P

Root password

Set the root password:

passwd

Add non root user

useradd -m john
usermod -aG wheel,audio,video,optical,power,storage john

Boot loader

For MBR Scheme

grub-install --target=i386-pc /dev/sdX

For EFI Scheme

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB

External device

If you are planning to install Arch Linix on an external disk then put the --removable flag to the grub command on top

Generating grub config file

grub-mkconfig -o /boot/grub/grub.cfg

Dualboot Windows with Arch

Because Grub will automatically detect Windows partition when generating grub config when using MBR, EFI need to make sure that grub is intalled inside the Windows boot partition

Network configuration

Start Netctl service

sudo systemctl start netctl

Enabling a profile

netctl enable profile

Automatically connect wifi as we roaming

sudo systemctl enable netctl-auto@interface.service

To enable at boot

sudo systemctl start netctl-auto@interface.service

Upgrade exsiting Arch install

sudo pacman -Sy archlinux-keyring && sudo pacman -Syu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment