Skip to content

Instantly share code, notes, and snippets.

@orzklv
Last active April 20, 2024 20:35
Show Gist options
  • Save orzklv/5ea7a57ed410f68385c2291719ba1f38 to your computer and use it in GitHub Desktop.
Save orzklv/5ea7a57ed410f68385c2291719ba1f38 to your computer and use it in GitHub Desktop.
Arch Installation bible written by Sokhibjon. This installation process suits and follows taste of Sokhibjon, so feel free to modify and create your `own` way of installing Arch Linux.

Arch Linux installation if you were Sokhibjon

#arch #linux #archlinux

Please, keep in mind that everything after # is a comment and should not be executed. Also, lots of configurations has been moved to the dotfiles repository.

Connect to the network:

ip -c a                    # to get info about ip address [warning: lgbt]
iwctl.                     # if you have to connect over wifi
device list                # to get to know name of wlan0
station wlan0 get-networks # to get the list of available routers
station wlan0 connect SSID # to connect to the given router

We will start changing the font and warming up clusters:

setfont ter-132n # make the font bigger and better
loadkeys us      # set the US english keyboard map
pacman -Syy      # refresh the database of package manager

If you love gambling: set country to Uzbekistan, else Russia (chances are 50/50 to fail in Uzbek mirror...)

reflector -c Uzbekistan --sort rate --save /etc/pacman.d/mirrorlist

Get started with partitions:

# [Guide]
# Use gdisk for gpt, fdisk mbr. Avoid cfdisk & gfdisk at any cost! 
# GUI & TUI while archlive is true evil!!!
# There is an instruction for single partition.
Drivers /dev/sdX1 /dev/sdX2 /dev/sdX3
Size limitations 200/500 MB 2 times RAM if less then 8GB or 8GB rest of the disk
Formatting mkfs.vfat /dev/sdX1 mkswap /dev/sdX2 mkfs.ext4 /dev/sdX3
Mount Point /mnt/boot/efi [swapfile] /mnt

Creating a single partition

Before proceeding with work, check the name of your disk:

# It should be something like /dev/sda or /dev/sdb or if you have nvme disk /dev/nvme0n1
lsblk

and the output should be something like this:

NAME    MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda       8:0    1 476.9G  0 disk
├─sda1    8:1    1    16G  0 part
│ └─md0   9:0    0    16G  0 raid1 [SWAP]
├─sda2    8:2    1     1G  0 part
│ └─md1   9:1    0  1022M  0 raid1 /boot
└─sda3    8:3    1 459.9G  0 part
  └─md2   9:2    0 459.8G  0 raid1 /
# Let's say you have nvme disk, then the command should be something like this:
gdisk /dev/nvme0n1

# gdisk will create GPT disk label for you, if it's your first partition, you may consider erasing the disk: 
o # erase the disk

# create a new partition
n # new partition

# For partition number and first sector, just press enter because default values are fine, but for the last sector, you have to write size of disk. Let's say we were creating a 512MB partition:
+512M # size of the partition

# Now, you have to choose the type of the partition. For EFI partition, you have to choose EFI System (ef00) type:
ef00 # type of the partition

# Now, create other partitions as well. Table for recommended partitions with it's instructions are given above.

# Write the changes to the disk:
w # write changes to the disk

Formatting a partition

# Take a look at the output of lsblk
# and find the name of the partition
mkfs.ext4 /dev/sdX1 # format the partition

Mounting a partition

Mounting disk is pretty easy task as all you have to know is the name of the partition and the mount point. For example, if you have a partition named /dev/sda1 and you want to mount it to /mnt, then the command should be something like this:

mount /dev/sda1 /mnt

Table for recommended partitions with it's instructions are given above.

Installing the essential packages for bootstrap

pacstrap /mnt base linux linux-firmware helix {intel-ucode | amd-ucode} git

Create the fstab files and chroot

genfstab -U /mnt >> /mnt/etc/fstab # generate fstab
arch-chroot /mnt                   # enter to the machine

Setup basic things

Date and locales

ln -sf /usr/share/zoneinfo/Asia/Tashkent /etc/localtime # link the localtime
hwclock --systohc     					                        # synchronise clock to hardware
helix /etc/locale.gen    					                      # uncomment utf-8.us
locale-gen            					                        # generate the locale files
helix /etc/locale.conf   					                      # content: LANG=en_US.UTF-8
helix /etc/vconsole.conf 					                      # content: KEYMAP=us

Host files

echo "berserk" >> /etc/hostname    # give a name to the machine
helix /etc/hosts.              # start editing the localhost routes

Contents /etc/hosts can be found here

Installing all required packages

pacman -S grub efibootmgr networkmanager network-manager-applet wpa_supplicant dialog mtools dosfstools reflector base-devel linux-headers bluez bluez-utils cups xdg-utils xdg-user-dirs rsync inetutils dnsutils nfs-utils gvfs gvfs-smb openssh

Installing optional packages

pacman -S zsh zsh-completions zsh-autosuggestions zsh-syntax-highlighting starship 

Choosing graphic driver

pacman -S xf86-video-amdgpu     # amd protcessors
pacman -S xf86-video-intel      # intel protcessors
pacman -S nvidia nvidia-utils   # nvidia grahps
pacman -S virtualbox-gues-utils # xf86-video-vmware # virtualbox

Change some parameter on mkinitcpio

helix /etc/mkinitcpio.conf # add {nvidia | amdgpu | i915} to MODULES
mkinitcpio -p linux        # compile for linux kernel

Create bootloader

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ICE # create the bootloader
helix /etc/default/grub                                                        # append video=1920x1080 to LINUX_DEFAULT # warn about the display
grub-mkconfig -o /boot/grub/grub.cfg                                           # update the config

Enabling all services

systemctl enable NetworkManager # turn on network management
systemctl enable bluetooth      # turn on bluetooth service
systemctl enable cups           # printer manager gets on
systemctl enable sshd           # ssh server is getting on also
# If there's error, it's totally ok as you don't have XDISPLAY
# currently running in your session, once reboot, it gets fixed!
systemctl enable --now reflector.timer  # make reflector refresh by the time
systemctl enable --now fstrim.timer     # make the ssd get updated by the time

Accounts

passwd                                  # enter password for the root user
useradd -mG wheel -s /usr/bin/zsh yuri  # create the user
passwd yuri                             # enter password for the user
EDITOR=helix visudo                     # open sudo privileges for wheel

Exit and reboot

exit
umount -a
exit
reboot

[~] Installing the DE (warning: cancer)

reflector -c [Russia|Uzbekistan] --sort rate --save /etc/pacman.d/mirrorlist
sudo pacman -S {xorg | wayland} {sddm | gdm} {kde: plasma kde-applications packagekit-qt5} {gnome: gnome gnome-tweaks}
sudo systemctl enable {gdm | sddm}

[~] or installing bspwm (tiling window manager)

reflector -c [Russia|Uzbekistan] --sort rate --save /etc/pacman.d/mirrorlist
sudo pacman -S xorg lightdm lightdm-webkit2-greeter lightdm-webkit-theme-litarvan bspwm sxhkd picom nitrogen rofi alacritty
sudo systemctl enable lightdm

If not already done, edit /etc/lightdm/lightdm.conf and set greeter-session=lightdm-webkit2-greeter. Then edit /etc/lightdm/lightdm-webkit2-greeter.conf and set theme or webkit-theme to litarvan. Configurations for bspwm and sxhkd are already included in my dotfiles. If you wanna manually configure it, then you can find the configuration files in the following links:

Installing the AUR manager and configure

If you're going to install my dotfiles, then you don't need to install the AUR manager as it already included on installation process of dotfile.

sudo pacman -S rustup   # Install rust to compile paru
rustup install stable   # Get the latest stable version
git clone https://aur.archlinux.org/paru.git .paru
cd .paru && makepkg -si # Compile the dang paru
cd .. && rm -rf .paru   # Remove the paru folder

A good old fashion massacre

All my configurations are hosted on GitHub repository and it's kinda very easy to install. Just run the following command:

curl -fsSL https://dots.orzklv.uz/install.sh | sh
127.0.0.1 localhost
::1 localhost
127.0.1.1 berserk.localdomain berserk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment