---
# System prepended metadata

title: Arch - Install (2023)
tags: [Install, Arch]

---

Arch - Install (2023)
===
###### tags: `Arch` `Install`

### Arch Script - Install Script
```bash
pacman -S archinstall
```

### Terminal Font
```
setfont ter-132n
```

### Check Network
```
ip -c a
ping archlinux.org -c 5
```

### Connect to WiFi (iwctl)
```
iwctl
device list                              #device list
device device_name show                  #device show info
station device_name connect wifi_name    #connect to wifi
```

### Check UEFI
```bash
efivar -l
ls /sys/firmware/efi/efivars
```

### Update Date & Time
```bash
timedatectl list-timezones   # Europe/Bucharest
timedatectl set-timezone Europe/Bucharest
timedatectl status
```

### Set Console Keyboard Layout
```bash
ls /usr/share/kbd/keymaps/i386/qwerty/    
# us.map.gz
# ro.map.gz
# ro_std.map.gz
# ro_win.map.gz
loadkeys /usr/share/kbd/keymaps/i386/qwerty/us.map.gz
```

### Check Disk Info
```bash
df -Th   #disk free - type, human-readable
lsblk    #list disks
```

### Disk Partitioning (TBC)
```bash
gdisk /dev/sda    #x - expert mode, z - zap (destroy)
cgdisk /dev/sda	
/dev/nvme0n1p1	EF00	boot    #1024MiB (EF00 for GPT and EF02 for MBR)
/dev/nvme0n1p6	8300	root    #..GiB
/dev/nvme0n1p7	8300	home    #..GiB
/dev/nvme0n1p8	8200	swap    #1.5 * RAM

mkfs.fat -F32 /dev/nvme0n1p1
mkfs.ext4 /dev/nvme0n1p6
mkfs.ext4 /dev/nvme0n1p7
mkswap /dev/nvme0n1p8
swapon /dev/nvme0n1p8
```

### Mount Paritions (TBC)
```bash
#mount root
mkdir /mnt
mount /dev/nvme0n1p6 /mnt

#mount home
mkdir /mnt/home
mount /dev/nvme0n1p7 /mnt/home

#mount boot
mkdir /mnt/boot/efi
mount /dev/nvme0n1p1 /mnt/boot/efi
#mount boot after arch-chroot
mkdir /boot/efi
mount /dev/nvme0n1p1 /boot/efi

#mount swap
swapon /dev/nvme0n1p8
```

### Pacman Mirrorlist
```bash
curl -o /etc/pacman.d/mirrorlist https://archlinux.org/mirrorlist/?country=RO
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
sed -i 's/^#Server/Server/' /etc/pacman.d/mirrorlist.bak
rankmirrors -n 7 /etc/pacman.d/mirrorlist.bak > /etc/pacman.d/mirrorlist
```

### Install Arch Base
```bash
packstrap -i /mnt base base-devel linux linux-lts linux-headers linux-firmware sudo vim nano neofetch networkmanager dhcpcd pulseaudio bluez wpa_supplicant ntfs-3g
```

### Generate fstab
```bash
genfstab -U -p /mnt >> /mnt/etc/fstab
sudo vim /mnt/etc/fstab
```

### <mark>CHROOT</mark> into newly installed Arch
```bash
arch-chroot /mnt /bin/bash
```

### Users and Passwords
```bash
passwd                 #root password
useradd -m -g users -G wheel,storage,power -s /bin/bash s9yn37
passwd s9yn37
```

### Setting up sudoers
```bash
sudo vim /etc/sudoers
%wheel ALL=(ALL) ALL   #uncomment
Defaults rootpw        #add
```

### Hostname
```bash
echo NUC > /etc/hostname
sudo vim /etc/hosts
# 127.0.0.1          localhost
# ::1                localhost
# 127.0.0.1          NUC.localhost          localhost
```

### Language
```bash
vim /etc/locale.gen    #uncomment #en_US.UTF-8 UTF-8
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8
```

### Time
```bash
ls /usr/share/zoneinfo/Europe/
ln -s /usr/share/zoneinfo/Europe/Bucharest > /etc/localtime
hwclock --systohc
```

### Check if EFI variables mounted
```bash
efivar -l
ls /sys/firmware/efi/efivars
mount -t efivarfs efivarfs /sys/firmware/efi/efivars
```

### Install Intel processors microcode
```bash
pacman -S intel-ucode
```

### Install 3D drivers support
```bash
#Mesa has a collection of open-source drivers for Intel graphics, AMD (formerly ATI) and NVIDIA GPUs. 
sudo pacman -S mesa
```

### UEFI - Boot
[Arch - Boot](https://hackmd.io/90fc_3PDQFqcAAHpyrVdDQ)

### Enabling internet connection
```bash
sudo systemctl enable dhcpcd.service
sudo systemctl enable NetworkManager.service
```

### <mark>REBOOT</mark>
```bash
exit //exit chroot
umount -R /mnt    #unmount everything
reboot            #reboot
journalctl        #check logs
```

### Enabling multilib for x64 system (TBC)
```bash
#uncomment [multilib] & AUR repository [archlinuxfr]
vim /etc/pacman.conf
#system update
pacman -Syu          
```

### Install yay
```bash
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
```

### Install bash-completion
```bash
pacman -S bash-completion
```

### Installing touchpad support (if needed)
```bash
sudo pacman -S xf86-input-synaptics
```

### Install Desktops
[Arch - Install Desktops (2023)](https://hackmd.io/HUYNSRfzTp67Uelne7bk7Q)
