How to install Arch Linux on a UEFI system.

 So, I think You've understood what I'm trying to convey here. I started with arch Linux coz I found very few guides on the web which are simple and updated. So let's start.


 

Here is what you'll need -

Warning - This is not as easy as other distros such as Debian and fedora. We'll work with the command line here. Do it at your own risk.

1.   Get the ISO and create a bootable media for UEFI(GPT partitioned.

Get the iso and create your install media. I hope you know how to.( If you don't, then forget arch. It's probably not for you.) After this, we got to boot into the USB.

2. Installation

Now let's boot into it. Make sure secure boot is disabled and you're booting in UEFI.
Select Arch Linux X86_64 when asked. This guide is not focusing on multiboot but all you need to do is not to meddle with windows partition. The companion guide to do that will be available soon. In this guide, we'll be using the entire disk. Multiboot users should see the partitioning part in the companion guide.

Once you boot into root@archiso we'll start doing all the stuff. 
When it shows up, enter iwctl. I'm using ethernet so I don't have to do that. 

Partitioning 
Now here we'll partition the disk. If you're dual-booting follow the dual boot guide for this part. So type cfdisk command. This will get you to a partition manager.

You got to select gpt here. In the next step, your disk will appear. Create three partitions in it. For demonstration, I'm using a VM here but you can do the same steps in your PC.
  • The first partition should be ESP. (150 MB)
  • The second should be your Linux filesystem. (Calculate it yourself)
  • Third swap. (Depending on your RAM, 4 GB if you've 4 GB RAM. If you got 16, you don't need any swap.)


Then click write and exit. In the next step we'll format and mount the partitions and start installing. So type here -
  • mkfs.ext4 /dev/sda1
  • mkfs.fat -F32 /dev/sda2
  • mkswap /dev/sda3 
  • swapon /dev/sda3
  • mount /dev/sda1 /mnt
  • mkdir /mnt/boot/efi
  • mount /dev/sda2 /mnt/boot/efi
Now we are done with partitioning and we'll start the installation. If you're doing this for the first time,then make sure you follow all the steps as I've mentioned.

Setting our mirrorlist

This is very important. Else your downloads will be super slow. So to do that type-
  • pacman -S nano
  • nano /etc/pacman.d/mirrorlist
Find your nearest mirror and move it up. Then type ctrl + O and then ctrl + X
This will make your downloads faster.  
 

System Install and configuration

Now it's the time to carry on the main stuff. So type -


 

  • pacstrap /mnt base base-devel linux linux-firmware vim
It will take some time to install the packages. Obviously depending on ur internet connection.
When you're done here type-
  • genfstab -U /mnt >> /mnt/etc/fstab 
  • arch-chroot /mnt (This step is very important when it comes to troubleshooting)
 Now we have to set up our timezone, locale etc, so follow the next steps carefully.
Type -
  • timedatectl list-timezones
  • timedatectl set-timezone US/Eastern (You should choose depending on your location)
Now our time-zone is done. Now we'll set up our locale. To accomplish that we need to open our /etc/locale.gen and uncomment the preferred language. So type in here-
  • nano /etc/locale.gen (Uncomment the lang you prefer)
  • locale-gen
  • echo LANG=en_US.UTF-8 > /etc/locale.conf
  • export LANG=en_US.UTF-8
Now is the time to set up our host name and password. So follow the commands carefully.
  • nano /etc/hostname
Type the hostname you want to use. It's basically the name of your computer. Here I'm using TechCS.
After finishing here we'll set up the hosts.
Type :
  • nano /etc/hosts
  • Follow this carefully.(Be sure to replace TechCS with your host name.)
        127.0.0.1            localhost 
        ::1                        localhost 
        127.0.1.1            TechCS 
Then save it and exit. (Command to do that will be given below)
Then type
  • passwd
  • (Enter your password)

GRUB Installation 

 Now this is very important. If you're dual booting, follow this from companion guide.

Type-

  • pacman -S efibootmgr grub (This will install grub and efibootmgr.)
  • grub-install --target=x86_64-efi --bootloader-id=GRUB --efi-directory=/boot/efi
  • grub-mkconfig -o /boot/grub/grub.cfg 
Now you're done!!!!!!!!!!!!!!!!!!!!!
But I hope you need a desktop manager too, so for those stuff, I'm writing a post-install for yall.
 

3. Post-Install

 So we're installing some packages to make our PC work smoothly. 

Type-

  • pacman -S xorg gnome (We're installing gnome as our desktop manager and xorg as server)
  •  systemctl start gdm.service
  • systemctl enable gdm.service
  • systemctl enable networkmanager.service
The other things we'll do after reboot.
So type-
  • exit
  • shutdown now
Detach your USB drive. Then boot directly into arch linux.

Enabling sudo and adding user.

This is very very important. You'll be pissed off later if you don't do this.....
So type -
  • su (Enter your passwd)
  • pacman -S sudo
  • sudo EDITOR=nano visudo 
This will launch /etc/sudoers in nano. Find wheel and uncomment it.Then type
  •  sudo useradd -m -g users -G wheel username 
  • sudo passwd username  
We're done here. 
If you liked the tutorial, then hit me a reply below. Don't forget to share it to your friends.
 
 
Regards,
TechCS 
 
 
 
 
Credits -
Archlinux.org for arch linux
Balenaetcher.io for etcher  
 


Comments

Popular posts from this blog

How to install Manjaro in Virtualbox.

Companion guide to install MacOS in Virtualbox using a Mac or hack.