How to install Arch Linux?
Install Arch Linux from USB
- Download the arch Linux iso from its website
- Make your USB Live bootable using the following command
dd if=archlinux.iso of=/dev/sdx
fdisk -l
If you have another OS installed on your computer you can use the following GUI USB bootable maker:
- Unetbootin
- Universal USB Installer
If you have your USB key ready then you can start the installation process.
- Start your computer
2. Configure the keyboard layout:
a. First, you must find your keyboard layout typing:
i. ls /usr/share/kbd/keymaps/**/*.map.gz
b. Set your keyboard layout with the command ‘loadkeys’
a. You must verify if your computer supports UEFI, you can type:
i. ls /sys/firmware/efi/efivars
b. . If the directory doesn’t exist, the system is booted in BIOS.
c. For UEFI support you must read the following documentation: 4. Check your internet connection typing:
a. ping -c 3 www.google.com
b. The output must look like this:
d. If your computer has a wifi device, you can use netctl:
a. ‘wifi-menu -o’ 5. Update the system clock:
i. ‘timedatectl set-ntp true’6. Partition the disks:
a. First you must identify your hard drive, you can see the storage devices with the command ‘fdisk -l’. The first hard drive generally is ‘/dev/sda’.
/boot | 200M |
/ | 15G – 20G |
swap | Variable |
/home | The rest of the disk |
RAM | Recommended swap |
1G | 1G |
2G – 4G | Half of RAM |
+4G | 2G |
c. Make the partitions with cfdisk (DOS partition tables) or cgdisk (GPT partition tables)
i. If your computer has UEFI support you should use GPT, and you must create a partition with partition type EFI system (EF00). Finally, you must mount the EFI partition at ‘/boot’. You don’t need to create a boot partition anymore.
ii. If you have a BIOS-GPT system, you must create a mebibyte partition with partition type BIOS boot (ef02), then you can create the other partitions like boot, root, and home.
iii. If you choose an MBR (DOS) partition table, you can create the system partitions only, like boot, root, and home.
iv.
Partitions types | |
Partition type | Code |
Linux Filesystem | 83 (cfdisk), 8300 (cgdisk) |
Linux Swap | 82 (cfdisk), 8200 (cgdisk) |
BIOS | ef02 (cgdisk) |
UEFI | EF00 (cgdisk) |
i. You must format the partitions before installing the system.
ii. Use the command: “mkfs.filsystem_type /dev/sdax”
iii. filesystem_type can be ext2, ext4, jfs, etc
iv. sdax is the partition number
v.
Partition | Partition Type | Command to format |
/boot | Linux Filesystem | mkfs.ext2 /dev/sdax |
/ | Linux Filesystem | mkfs.ext4 /dev/sdax |
swap | Linux swap | mkswap /dev/sdax |
/home | Linux Filesystem | mkfs.ext4 /dev/sdax |
EFI | EFI | mfks.fat -F32 /dev/sdax |
vii. Format the swap partition with mkswap and after you must enable the swap with the command ‘swapon /dev/sdax’
i. Mount the root partition at /mnt
ii. Make the boot subdirectory in /mnt
iii. Make the home subdirectory in /mnt
iv. Mount the boot partition at /mnt/boot, if you created an EFI partition you must mount it at /mnt/boot
v. Mount the home partition at /mnt/home
vi. Example
i. ‘pacstrap /mnt base’
ii. For the bootloader you must install grub: ‘pacstrap /mnt grub’
iii. For network management you must install networkmanager: ‘pacstrap /mnt networkmanager’
iv. Example
i. Generate a fstab file (use -U or -L to define by UUID or labels, respectively):
a. Change root into the new system: ‘arch-chroot /mnt/bin/bash’
b. Set the timezone
i. List the regions
d. ‘hwclock –systohc’ iii. Uncomment your localization in ‘/etc/locale.gen’ using ‘nano’
a. ‘nano /etc/locale.gen’
For example: echo LANG=en_US.UTF-8 > /etc/locale.conf
v. If you set the keyboard layout, make the changes persistent in ‘vconsole.conf’
Creating a new initramfs is usually not required, because mkinitcpio was run on installation of the linux package with pacstrap.
Use the ‘passwd’ command
i. If you have an Intel CPU, install the intel-ucode package in addition, and enable microcode updates.
ii. Run the grub installation: ‘grub-install /dev/sda’
x. Unmount the partitions
‘umount /mnt/{boot,home,}’
a. If you have a wireless connection you can use the following command:
‘nmcli dev wifi connect “SSID” password “pass”’13. Finally, you can create a new user with the following command:
‘useradd -m -g users -G audio,lp,optical,storage,video,wheel,games,power,scanner -s /bin/bash user’
Conclusion
So that was it. I hope that now you know how to install Arch Linux. It was a little longer tutorial and that’s why installing Arch Linux is a little tedious job. But once you to install it, you’ will enjoy it. The benefits of using Arch Linux is that one can customize it the way he/she wants. After the install, you’ll need more help so I suggest the following documentation to enhance your knowledge about Arch Linux.
Also don’t hesitate to drop a comment below this article, if you did not understand any particular part of this article.
More Information at:
Boot loaders | https://wiki.archlinux.org/index.php/Category:Boot_loaders |
Network Manager | https://wiki.archlinux.org/index.php/NetworkManager |
Post Installation | https://wiki.archlinux.org/index.php/General_recommendations |
Also Read – Arch Linux Take Your Linux Knowledge To Next Level
Just installed my first Arch Linux on a VirtualBox after the steps, presented here.
The only point, i had to find an answer elsewhere, was the start of NetworkManager.service, which wasn’t installed by default and couldn’t be loaded by pacman, because i had no connection to the internet, though i had connection during the live-session. The solution was to stop and start the dhcpd again, so i was able to get the NetworkManager-package.
Awesome article, thank you very much for your efforts!
Great! This article have made me install arch linux for the first succeeded on my old notebook.
I could see mine started after for three days made me confused. But now I can use it again.
The only one of my missed step in other article that do not show how to make boot drive and I couldn’t find article that giving tutorial for MBR partition scheme. I go to Arch Wiki, but I couldn’t understand well to follow instructions showed. So, here my last article I seen.
Thanks in advance. Very nice article!
PPA appears to need secure boot. As you are describing updating drivers, is it assumed secure boot is enabed? I know its been mentioned certain lenovo and thinkcentre products need this but its not clear if there is a general need for installation of NVIDIA drivers?