Skip to content

Instantly share code, notes, and snippets.

@Sakib37
Created February 22, 2019 15:30
Show Gist options
  • Save Sakib37/fb8be2c22a6262eb84c930f01324de70 to your computer and use it in GitHub Desktop.
Save Sakib37/fb8be2c22a6262eb84c930f01324de70 to your computer and use it in GitHub Desktop.
Arch linux installation instruction
https://bbs.archlinux.org/viewtopic.php?id=148038
https://www.youtube.com/watch?v=mHX9UIll014
######################################################
######### Arch Linux Installation ####################
######################################################
1. Create a Usb bootable media with the same label of the Arch version. For example, if the arch
version is 15.09 then the lable of the USB should be ARCH_201509. This is mandatory as installtion
will search for a bootable media by this name.
insert the bootable media and connect to wifi using the 'wifi-menu' command
2. Create partition for the installation. Different partitioning software is used for different partion.
For GPT partion in UEFI Bios system I used gdisk.
- run the command 'gdisk /dev/sda' where sda is the main storage of the computer.
- in gdisk for the line "command(? for help):" press '?' to get all the command syntax.
- To create a new partion press 'n' and in the last sector give desired space as '+9GB'
- First partition is 100MB small partition. Second partition is swap partiotion which will
be used as a virtual memory. It is suggested to put swap patition equal to the size of the
ram in the computer. For Swap partition the hex code will be '8200'. Default partition code
is 8300 which represents linus filesystem partition(ext4)
- Now create the root partition.
- After creating all the partition write the changes in the hard drive using 'w' command of gdisk.
3. Format the swap partition using the follwoing command:
mkswap -L "Linux Swap" /dev/sdaX # Here X is the swap partition number
4. Turn on the swap partition
swapon /dev/sdaX # Here X is the swap partition number
5. Verify the Swap partition
free -m
6. Format root partition with ext4 file system
mkfs.ext4 -L "Arch Linux" /dev/sdaX # Here X is the root partition number
7. Now mount the root partition for the installation
mount /dev/sdaX /mnt # Here X is the root partition number
8. Install base system
pacstrap -i /mnt base base-devel
9. Mount the efi partition
mkdir -p /mnt/boot/efi
# gdisk -l /dev/sda will give the EFI partition on the hard drive
mount /dev/sdaX /mnt/boot/efi # Here X is the EFI partition number
10. Generate the fstab
genfstab -p /mnt >> /mnt/etc/fstab
11. Chroot into the arch installation
arch-chroot /mnt
12. Change the root password
passwd root
13. Set timezone
ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime
14. Generate the initial ram disk
mkinitcpio -p linux
15. Setup bootloader
pacman -Syu grub efibootmgr
grub-mkconfig -o /boot/grub/grub.conf
grub-install /dev/sda # For dual boot install grub in the main disk /dev/sda
16. Verify grub installation
ls -l /boot/efi/EFI/arch/
17. Install necessary driver and softwares
pacman -Syu wireless_tools iw dialog wpa_supplicant gnome gnome-desktop xorg-server xorg-xinit xorg-server-utils
xorg-apps xorg-twm xorg-xclock mesa xf86-input-synaptics xf86-video-intel pulseaudio alsa-utils tmux terminator bash-completion
vim git libreoffice-fresh os-prober
18. Create a new user in the wheel group so that we do not need to use the root account
useradd -m -G wheel -s /bin/bash -c "Admin" user_name
19. Create password for the user
passwd user_name
20. Modify permission for the new user.
visudo
Uncomment the line for the wheel group
21. Modify /etc/locale.gen file
uncomment the line
en_US.UTF-8
en_US ISO
22. Generate the locale file
locale-gen
23. Configure the /etc/locale.conf file adding
LANG=en_US.UTF-8
24. Run the command
export LANG=en_US.UTF-8
25. Set hardware clock to UTC time
hwclock --systohc --utc
26. Edit hostname
echo host_name > /etc/hostname
27. Modify /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
28. Enable gdm and NetworkManager
sudo systemctl enable gdm
sudo systemctl enable NetworkManager
29. In UEFI dual boot find the windows bootloader file using
sudo efibootmgr -B
# Usually the location is /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
30. Copy the windows bootloader in one level up to keep a backup
cp /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi /boot/efi/EFI/Microsoft/
31. Copy the arch grub file in windows bootloaders place.
cp /boot/efi/EFI/arch/grub_64..efi /boot/efi/EFI/Microsoft/Boot
32. Restart and remove the media and log back in Arch linux.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment