The first step is to download the archlinux.iso image from https://archlinux.org/download and make a bootable USB drive.
Boot from the USB drive
Check if you have an Internet connection
ping www.archlinux.org
Sync localtime with an NTP time server
timedatectl set-ntp true
Manage your disk and disk partitioning
First, check your disks:
fdisk -l
Example:
Disk /dev/sda: 2000.4 GB, 2000398934016 bytes 255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x00071a75
fdisk /dev/sda
Create a partition table by entering g
Pressn
and create the first partition of 200M and set the type as EFI boot t select 1, or check what you need by typing l to get the list
Pressn
and create the second partition of 15G (for your root)
Pressn
and create the third partition of the rest of your disk for your home directory.
Format the partitions
mkfs.fat -F32 /dev/sda1
mkfs.ext4 /dev/sda2
mkfs.ext4 /dev/sda3
Mount the partitions
mount /dev/sda2 /mnt
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot
mkdir /mnt/home
mount /dev/sda3 /mnt/home
Now let`s make sure we are using the fastest mirrors
Install reflector:pacman -S reflector
Run the following command:
reflector --verbose –c [%COUNTRY%] --latest 10 --sort rate --save /etc/pacman.d/mirrorlist
Install the basic OS on the root partition
pacstrap /mnt base base-devel linux linux-firmware nano vim neovim
Generate the fstab file
genfstab -U /mnt >> /mnt/etc/fstab
Chroot into your installation arch-chroot /mnt
and perform the following steps:
fallocate -l [The size you want for your swapfile] /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
vim /etc/fstab
Add to the end of the file
/swapfile none swap defaults 0 0
ln -sf /usr/share/zoneinfo/[region]/[city] /etc/localtime
hwclock --systohc
Uncomment en_US.UTF-8 or you’re needed locale from the /etc/locale.gen
file and generate your locale with locale-gen
Create the locale.conf
file, adn set the LANG variable to your locale:
vim /etc/locale.conf
add LANG=(you're locale)en_US.UTF-8
Create the hostname file:
vim /etc/hostname
and add you’re hostname to that file and save it.
Add entries for your hostname to the hosts file:
vim /etc/hosts
127.0.0.1 localhost
::1 localhost
127.0.1.1 [HOSTNAME].localdomain [HOSTNAME]
Set the root password: passwd
Install the needed network tools:
pacman -S networkmanager network-manager-applet wireless_tools wpa_supplicant
Enable the networkmanager: systemctl enable NetworkManager
Let’s install some extras for bluetooth and sound:
pacman -S linux-headers bluez bluez-utils git pulseaudio pulseaudio-bluetooth pulseaudio-alsa pulseaudio-equalizer pulseaudio-jack xdg-utils xdg-user-dirs
Enable bluetooth: systemctl enable bluetooth
Install Grub and the EFI bootmanager:
pacman -S grub efibootmgr
Install and configure grub:
grub-install --target=x86_64-efi --bootloader-id=GRUB --efi-directory=/boot
grub-mkconfig -o /boot/grub/grub.cfg
Create you’re user account and edit the sudoers file, so, you will be able to execute root commands using sudo
:
useradd -m -G wheel -s /bin/bash [USERNAME]
passwd [USERNAME]
visudo
: uncomment the # before the %wheel group and save the file
Exit the chroot environment by typing exit or Ctrl+d.
Reboot the system and you should be able to login with you’re user account.
Check if sudo rights are set correctly by using the following command to update the mirrors and update you’re system:
sudo pacman -Syyu
Install the xorg environment and video drivers for you’re system:
sudo pacman -S xorg xorg-xinit xf86-video-[processor-type] (for Nvidia GPU, install [nvidia]) bash-completion
After this, you will be able to install any desktop environment or window manager.