Install Arch with swapfile baby.

Hi, let's get started with our install. Download the ISO and boot it however you want. 1. Connect to WiFi # Connect to your WiFi (replace with your network) iwctl station wlan0 connect 2. Test the Connection # Ping a website to check connectivity ping kbbohara.com.np 3. Enable NTP # Set network time protocol timedatectl set-ntp true 4. Identify Your Disk # List disks to identify your target disk (mine is /dev/sda) lsblk 5. Partition the Disk # Partition disk /dev/sda: fdisk /dev/sda # Inside fdisk, input the following: # g -> Create a new GPT partition table # n -> Create new partition (EFI) # -> Accept default partition number # -> Accept default first sector # -> Enter "+512M" for size # n -> Create new partition (Linux filesystem) # -> Accept defaults to use the remaining space # w -> Write changes and exit 6. Format the Partitions # Format EFI partition as FAT32 and Linux partition as ext4 mkfs.fat -F32 /dev/sda1 mkfs.ext4 /dev/sda2 7. Mount the Partitions # Mount the Linux partition and create/mount the boot directory for EFI mount /dev/sda2 /mnt mkdir -p /mnt/boot mount /dev/sda1 /mnt/boot 8. Install Base Packages # Install base system, Linux kernel, firmware, and vim pacstrap /mnt base linux linux-firmware vim 9. Generate fstab # Generate filesystem table genfstab -U /mnt >> /mnt/etc/fstab cat /mnt/etc/fstab 10. Change Root # Enter the new system environment arch-chroot /mnt 11. Create Swapfile # Create and activate a 16GB swapfile fallocate -l 16GB /swapfile chmod 600 /swapfile mkswap /swapfile swapon /swapfile 12. Add Swapfile to fstab # Open fstab and add the swapfile entry at the end vim /etc/fstab # Add: /swapfile none swap defaults 0 0 13. Set Timezone & Clock # Link timezone and sync hardware clock ln -sf /usr/share/zoneinfo/Asia/Kathmandu /etc/localtime hwclock --systohc 14. Configure Locale # Edit locale.gen to uncomment en_US.UTF-8 and generate locale vim /etc/locale.gen locale-gen echo "LANG=en_us.UTF-8" > /etc/locale.conf 15. Set Hostname # Set hostname to "arch" echo "arch" > /etc/hostname 16. Configure Hosts File # Edit /etc/hosts for proper hostname resolution vim /etc/hosts # Add the following: # 127.0.0.1 localhost # ::1 localhost # 127.0.1.1 arch.localdomain arch 17. Set Root Password # Set the root password passwd 18. Install & Configure systemd-boot # Install systemd-boot on the EFI partition bootctl install # Create loader configuration vim /boot/loader/loader.conf # Add: # default arch # timeout 3 # editor no # Create boot entry for Arch Linux vim /boot/loader/entries/arch.conf # Add: # title Arch Linux # linux /vmlinuz-linux # initrd /initramfs-linux.img # options root=UUID= rw # Get UUID: blkid /dev/sda2 19. Install Additional Packages & Finalize # Install necessary packages pacman -S networkmanager network-manager-applet wpa_supplicant dialog os-prober mtools dosfstools base-devel linux-headers # Exit chroot, unmount all partitions, and reboot exit umount -a reboot Post-Install Steps Connect to WiFi with nmcli # Use nmcli or your preferred network manager after reboot nmcli device wifi list nmcli device wifi connect password Create a New User # Create a new user and add to the wheel group useradd -m -G wheel baby passwd baby # Allow wheel group sudo privileges EDITOR=vim visudo # Uncomment: %wheel ALL=(ALL) ALL Install GPU Drivers # For Intel: sudo pacman -S xf86-video-intel # For AMD: sudo pacman -S xf86-video-amdgpu # For NVIDIA: sudo pacman -S nvidia nvidia-utils Audio Setup // By default, ALSA provides basic audio support. // For a modern audio stack, install PipeWire. # Install PipeWire and its PulseAudio replacement sudo pacman -S pipewire pipewire-pulse pipewire-alsa // Most apps will use PipeWire automatically. // Optionally, install a volume control (e.g., pavucontrol) if needed. sudo pacman -S pavucontrol // That's it for audio! Install Hyprland and a Greeter # Install Hyprland (Wayland compositor) sudo pacman -S hyprland # For a login greeter, consider installing ly sudo pacman -S ly // Done. Enjoy your Arch Linux with Hyprland!

Feb 6, 2025 - 20:27
 0
Install Arch with swapfile baby.

Hi, let's get started with our install. Download the ISO and boot it however you want.

1. Connect to WiFi

# Connect to your WiFi (replace  with your network)
iwctl station wlan0 connect 

2. Test the Connection

# Ping a website to check connectivity
ping kbbohara.com.np

3. Enable NTP

# Set network time protocol
timedatectl set-ntp true

4. Identify Your Disk

# List disks to identify your target disk (mine is /dev/sda)
lsblk

5. Partition the Disk

# Partition disk /dev/sda:
fdisk /dev/sda

# Inside fdisk, input the following:
#  g        -> Create a new GPT partition table
#  n        -> Create new partition (EFI)
#           -> Accept default partition number
#           -> Accept default first sector
#           -> Enter "+512M" for size
#  n        -> Create new partition (Linux filesystem)
#           -> Accept defaults to use the remaining space
#  w        -> Write changes and exit

6. Format the Partitions

# Format EFI partition as FAT32 and Linux partition as ext4
mkfs.fat -F32 /dev/sda1
mkfs.ext4 /dev/sda2

7. Mount the Partitions

# Mount the Linux partition and create/mount the boot directory for EFI
mount /dev/sda2 /mnt
mkdir -p /mnt/boot
mount /dev/sda1 /mnt/boot

8. Install Base Packages

# Install base system, Linux kernel, firmware, and vim
pacstrap /mnt base linux linux-firmware vim

9. Generate fstab

# Generate filesystem table
genfstab -U /mnt >> /mnt/etc/fstab
cat /mnt/etc/fstab

10. Change Root

# Enter the new system environment
arch-chroot /mnt

11. Create Swapfile

# Create and activate a 16GB swapfile
fallocate -l 16GB /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile

12. Add Swapfile to fstab

# Open fstab and add the swapfile entry at the end
vim /etc/fstab
# Add: /swapfile none swap defaults 0 0

13. Set Timezone & Clock

# Link timezone and sync hardware clock
ln -sf /usr/share/zoneinfo/Asia/Kathmandu /etc/localtime
hwclock --systohc

14. Configure Locale

# Edit locale.gen to uncomment en_US.UTF-8 and generate locale
vim /etc/locale.gen
locale-gen
echo "LANG=en_us.UTF-8" > /etc/locale.conf

15. Set Hostname

# Set hostname to "arch"
echo "arch" > /etc/hostname

16. Configure Hosts File

# Edit /etc/hosts for proper hostname resolution
vim /etc/hosts
# Add the following:
# 127.0.0.1   localhost
# ::1         localhost
# 127.0.1.1   arch.localdomain arch

17. Set Root Password

# Set the root password
passwd

18. Install & Configure systemd-boot

# Install systemd-boot on the EFI partition
bootctl install

# Create loader configuration
vim /boot/loader/loader.conf
# Add:
# default  arch
# timeout  3
# editor   no

# Create boot entry for Arch Linux
vim /boot/loader/entries/arch.conf
# Add:
# title   Arch Linux
# linux   /vmlinuz-linux
# initrd  /initramfs-linux.img
# options root=UUID= rw
# Get UUID: blkid /dev/sda2

19. Install Additional Packages & Finalize

# Install necessary packages
pacman -S networkmanager network-manager-applet wpa_supplicant dialog os-prober mtools dosfstools base-devel linux-headers

# Exit chroot, unmount all partitions, and reboot
exit
umount -a
reboot

Post-Install Steps

Connect to WiFi with nmcli

# Use nmcli or your preferred network manager after reboot
nmcli device wifi list
nmcli device wifi connect  password 

Create a New User

# Create a new user and add to the wheel group
useradd -m -G wheel baby
passwd baby

# Allow wheel group sudo privileges
EDITOR=vim visudo
# Uncomment: %wheel ALL=(ALL) ALL

Install GPU Drivers

# For Intel:
sudo pacman -S xf86-video-intel

# For AMD:
sudo pacman -S xf86-video-amdgpu

# For NVIDIA:
sudo pacman -S nvidia nvidia-utils

Audio Setup

// By default, ALSA provides basic audio support.
// For a modern audio stack, install PipeWire.

# Install PipeWire and its PulseAudio replacement
sudo pacman -S pipewire pipewire-pulse pipewire-alsa

// Most apps will use PipeWire automatically.
// Optionally, install a volume control (e.g., pavucontrol) if needed.
sudo pacman -S pavucontrol

// That's it for audio!

Install Hyprland and a Greeter

# Install Hyprland (Wayland compositor)
sudo pacman -S hyprland

# For a login greeter, consider installing ly
sudo pacman -S ly

// Done. Enjoy your Arch Linux with Hyprland!