Skip to content

Instantly share code, notes, and snippets.

@chrisleekr
Last active June 21, 2019 07:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisleekr/0ac5e15fba87a408de20f3ffebe1f405 to your computer and use it in GitHub Desktop.
Save chrisleekr/0ac5e15fba87a408de20f3ffebe1f405 to your computer and use it in GitHub Desktop.
Step by step guide to install Arch Linux for myself

Step by step guide to install Arch Linux for myself

Environment:

SSD (NVME): 256GB, but available only 238.5GB

RAM: 16GB

References

Step by Step

Partition

$ gdisk /dev/nvme0n1

# Delete all partitions
command: d

# Create a brand new GUID partition table
command: o
proceed? y

# Create 512M boot
command: n
Partition number (2-128, default 1):                                   
First sector (34-XXXXXX), default = YYYY) or {+-}size{KMGTP}:          
Last sector (64-XXXXXX), default = XXXXXX) or {+-}size{KMGTP}: +512MB  
Current type is 'Linux filesystem'                                     
Hex code or GUID (L to show codes, Enter = 8300): EF00  

# Create 16GB Swap
command: n

Partition number (2-128, default 2):                                   
First sector (34-XXXXXX), default = YYYY) or {+-}size{KMGTP}:          
Last sector (64-XXXXXX), default = XXXXXX) or {+-}size{KMGTP}: +16GB  
Current type is 'Linux filesystem'                                     
Hex code or GUID (L to show codes, Enter = 8300): 8200  

# Allow ramining space to Linux partition
command: n

Partition number (2-128, default 3):                                   
First sector (34-XXXXXX), default = YYYY) or {+-}size{KMGTP}:          
Last sector (64-XXXXXX), default = XXXXXX) or {+-}size{KMGTP}:  
Current type is 'Linux filesystem'                                     
Hex code or GUID (L to show codes, Enter = 8300): 8300  

command: p

command: w
$ lsblk /dev/nvme0n1

$ mkfs.fat -F32 /dev/nvme0n1p1
$ mkswap /dev/nvme0n1p2
$ swapon /dev/nvme0n1p2
$ mkfs.ext4 /dev/nvme0n1p3

$ mount /dev/nvme0n1p3 /mnt
$ mkdir -p /mnt/boot
$ mount /dev/nvme0n1p1 /mnt/boot

Connect wireless


$ iw dev

$ ip link set wlp3s0 up
$ iw dev wlp3s0 scan | grep 'SSID:'
$ wpa_supplicant -i wlp3s0 -c <(wpa_passphrase 'networkname' 'network password') 
$ dhcpcd wlp3s0
$ ping -c1 archlinux.org
$ timedatectl set-ntp true

Download and install base packages

$ cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
$ cat /etc/pacman.d/mirrorlist.bak | grep -A1 Australia > /etc/pacman.d/mirrorlist
$ vi /etc/pacman.d/mirrorlist
# Remove --
$ pacstrap /mnt base

Generate fstab

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

Chroot

$ arch-chroot /mnt

Timezone

$ ln -sf /usr/share/zoneinfo/Australia/Melbourne /etc/localtime
$ hwclock --systohc

Localization

$ vi /etc/locale.gen
# Uncomment 
en_AU.UTF-8
ko_KR.UTF-8

$ locale-gen
$ vi /etc/locale.conf
LANG=en_AU.UTF-8

$ vi /etc/vconsole.conf
KEYMAP=us

Netowrk configuration

$ vi /etc/hostname
saturn

$ vi /etc/hosts
127.0.0.1	localhost
::1		localhost
127.0.1.1	saturn.localdomain	saturn

Initramfs

$ mkinitcpio -p linux

Root password

$ passwd

Bootloader

$ bootctl --path=/boot install

$ blkid /dev/nvme0n1p3
# Copy PARTUUID="
# 48afc3b0-57ca-d248-82fe-66a2fe1ab62a

$ vi /boot/loader/entries/arch.conf

title   Arch Linux
linux   /vmlinuz-linux
initrd  /initramfs-linux.img
options root=PARTUUID=YOUR-PARTUUID-CODE-HERE rw

$ echo ' ' > /boot/loader/loader.conf
$ vi /boot/loader/loader.conf

default arch
timeout 4
console-mode max
editor no

$ bootctl --path=/boot update

Gnome and some packages

$ pacman -S xorg xorg-server
$ pacman -S gnome gnome-extra
$ systemctl start gdm.service
$ system enable gdm.service
$ pacman -S networkmanager iw wpa_supplicant dialog wireless_tools
$ systemctl enable NetworkManager.service
$ systemctl enable wpa_supplicant.service

Add user

$ useradd -m chrislee
$ passwd chrislee

Reboot

$ exit
$ umount /mnt/boot /mnt
$ reboot

Install yay

$ sudo pacman -S base-devel
$ git clone https://aur.archlinux.org/yay.git
$ cd yay
$ makepkg -si

Install fish

$ yay -S fish
$ curl -L https://get.oh-my.fish | fish
$ sudo pacman -S fzf
$ omf install https://github.com/jethrokuan/fzf
$ omf install bobthefish
$ chsh -s /usr/local/bin/fish
$ git clone https://github.com/powerline/fonts.git --depth=1
$ cd fonts
$ ./install.sh
$ cd ..
$ rm -rf fonts
$ gnome-terminal -e fish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment