Skip to content

Instantly share code, notes, and snippets.

@jhadeepakkumar14
Last active January 7, 2024 05:55
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 jhadeepakkumar14/36866a5c8dd15a182de4117ed3ffeba8 to your computer and use it in GitHub Desktop.
Save jhadeepakkumar14/36866a5c8dd15a182de4117ed3ffeba8 to your computer and use it in GitHub Desktop.
Installation Step of Arch Linux in dual boot

Installation of Arch Linux

Pre-requisite:

  • USB thumb drive with atleast 16GB memory
  • ArchLinux ISO file downloaded(https://archlinux.org/download/ - You can use magnet link to download arch linux)
  • Make sure you have disabled safe boot, you can enable it again after installation
  • Make sure you have empty partition present in you SSD
  • Make sure you are connected with wired lan connection, otherwise you need to connect with wifi in step 2

Step 1:

Step 2:

  • Boot the machine with USB thumb drive
  • once you get into arch console, make sure you have internet connection. ip a if you are not connected with wired connection then connection with wifi using below commands
    • iwctl
    • device list - this will give name of your wifi connection(e.g wlan0)
    • station wlan0 scan - this will scan all available wifi networks
    • station wlan0 get-networks - this will show all the available networks
    • station wlan0 connect YOUR-WIFI-NAME
    • exit
    • ip a - this should show ip in wlan0

Step 3:

  • Check your partition using fdisk -l or lbslk
  • Run the following to do create required partition,
    • cfdisk /dev/nvme0n1
    • this will show all the parition, you can use up and down arrow to select your partition where you want to install arch linux, then select NEW if it is free space, otherwise select DELETE if partition is not empty. If you already have EFI partition present, then don't create EFI partition. Only create root and swap partition. If your partition size if 250GB then give root 240GB and give SWAP partition 10GB. Once partition is created, select WRITE and type yes. It will create all the required partitions.
  • Now we need to format the partition
    • mkfs.ext4 /dev/root_partition to format the root partition
    • mkswap /dev/swap_partition to format the swap partition
  • Now we need to mount the partitions
    • mount /dev/root_partition /mnt - this will mount root partition
    • mount --mkdir /dev/efi_partition /mnt/boot/efi - this will mount current EFI partition
    • swapon /dev/swap_partition - this will enable swap partition

Step 4:

  • Install essential packages
    • pacstrap -K /mnt base linux linux-firmware vim - you can change linux kernel name to install other versions e.g linux-hardened
  • Configure the system
    • genfstab -U /mnt >> /mnt/etc/fstab
  • Change the time
    • ln -sf /usr/share/zoneinfo/Asia/Calcutta /etc/localtime
  • Go to root
    • arch-chroot /mnt
  • hwclock --systohc
  • Edit /etc/locale.gen and uncomment en_US.UTF-8
  • locale-gen
  • vim /etc/locale.conf and write LANG=en_US.UTF-8 in this file
  • vim /etc/vconsole.conf and write KEYMAP=us in this file
  • vim /etc/hostname and write hostname in this file e.g arch
  • vim /etc/hosts and write these in this file
    • 127.0.0.1 localhost
    • ::1 localhost
    • 127.0.1.1 arch.localdomain arch
  • vim /etc/mkinitcpio.conf and search for HOOKS and make sure to move block and keyboard before autodetect
  • mkinitcpio -p linux
  • Create GRUB boot loader
    • grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-d=GRUB
    • grub-mkconfig -o /boot/grub/grub.cfg

Step 5:

  • Add new user
  • useradd -mG wheel deepak
  • Set password for new user
  • passwd deepak
  • EDITOR=vim visudo - search for wheel section and enable it for sudo

Step 6:

  • Install Xorg (Display Server):
    • pacman -S xorg
  • Install Graphics Drivers: Choose the appropriate graphics driver based on your hardware. For Intel graphics, you might need xf86-video-intel, for AMD, you might need xf86-video-amdgpu, and for NVIDIA, you might need nvidia. Install the driver that matches your hardware:
    • For Intel: pacman -S xf86-video-intel
    • For AMD: pacman -S xf86-video-amdgpu
    • For NVIDIA (proprietary driver): sudo pacman -S nvidia
  • Install Basic Input Drivers:
    • pacman -S xf86-input-libinput
  • Install GUI Environment: Choose a desktop environment or window manager of your preference. Popular choices include XFCE, KDE, or i3:
    • For XFCE: pacman -S xfce4 xfce4-goodies
    • For KDE: pacman -S plasma kde-applications
    • For i3 (a tiling window manager): sudo pacman -S i3 dmenu
  • Install Additional Drivers and Tools (Optional): Depending on your hardware and needs, you might want to install additional drivers or tools. For example:
    • For sound support: sudo pacman -S alsa-utils pulseaudio
  • Install Display Manager (Optional): Install a display manager to manage your graphical login screen. For example, for LightDM:
    • pacman -S lightdm lightdm-gtk-greeter
    • systemctl enable lightdm
  • Enable Network Services:
    • systemctl enable NetworkManager
  • exit from chroot
  • umount -R /mnt and remove USB thumb drive
  • reboot

Step 7: (Optional)

  • If for any reason you messed up the installation. Login to your window machine, format the partition and install again.
  • In some cases, your boot loaded still holds GRUB and it does not delete it. To delete from boot loader follow these commands
  • Open CMD as Admin in window
  • diskpart
  • select disk 0
  • list partition
  • select partition 1 - make sure you select efi partition here
  • assign letter=x
  • exit - exit from disk part
  • x: this will direct you to efi partition
  • cd efi
  • dir
  • rd GRUB /s - this will delte GRUB from boot loader
  • restart the system, it will unmount efi automatically.

You should able to boot Arch linux successfully. For deltailed official installation guide refer here (https://wiki.archlinux.org/title/installation_guide) https://www.youtube.com/watch?v=yaThYGr37DI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment