Arch Linux Installation Handbook
Index
- Install Arch Linux
- Install blackarch on top of arch linux
Install Arch Linux
Verify Boot Mode
Check if you have an efi or bios system.
ls /sys/firmware/efi/efivars
Make sure you have internet
To make sure you have internet connection, simply ping to any valid website.
ping saifshahriar.github.io
Update the system clock
Use timedatectl
to make sure the system clock is accurate.
timedatectl set-ntp true
To check the status simply type,
timedatectl status
Partitioning the disk
Use cfdisk
tool to partition the disks.
- Make 3 partitions
- boot
- Size:
128M
- Bootable:
[ * ]
- Name:
/dev/sda1
- Size:
- swp
- Size:
1G
- Type:
Swap/Solaris
- Name:
/dev/sda2
- Size:
- rooot
- Size: Rest of the space
- Name:
/dev/sda3
- boot
Format partitions
# format boot & root
mkfs.ext4 /dev/sda1
mkfs.ext4 /dev/sda3
# format swp
mkswap /dev/sda2
Mount the file systems
- Mount
root
first:
mount /dev/sda3 /mnt
- Boot:
- Now make a
boot
directory inside/mnt
:
mkdir /mnt/boot
- Now mount
boot
:
mount /dev/sda1 /mnt/boot
- Now make a
- Mount
swp
:
swapon /dev/sda2
lsblk
to check the partition info
Installation
Select the mirrors:
vim /etc/pacman.d/mirrorlist
Install essential packages
pacstrap /mnt base base-devel linux linux-firmware vim networkmanager git grub opendoas
Configure the system
Fstab (contains all the drivers)
genfstab -U /mnt >> /mnt/etc/fstab
Chroot
arch-chroot /mnt
Enable network manager at boot
systemctl enable NetworkManager
Install a boot loader (grub)
grub-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
Optional
User setup
vim /etc/hostname
put arch
there
Timezone
ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
hwclock --systohc
Localization
vim /etc/locale.gen
# Uncomment needed locale
locale-gen
Now go to the vim /etc/locale.conf
and add the line LANG=en_US.UTF-8
Set users
# To setup root passwd
passwd
# Add another user and passwd
useradd -m saif
passwd saif
# Give user the permission
usermod -aG wheel,audio,video,optical,storage saif
- Configure superuser privilege:
- Edit the sodoers file. (if you are using doas insted of sudo then see the next point)
visudo
Uncomment the following line
## Allow members of group wheel to execute any command
- # %wheel ALL=(ALL:ALL) ALL
+ %wheel ALL=(ALL:ALL) ALL
## Uncomment to allow members of group wheel to execute any command
- # %sudo ALL=(ALL:ALL) ALL
+ %sudo ALL=(ALL:ALL) ALL
- doas configuration:
Create a name
/etc/doas.conf
touch /etc/doas.conf
Now add these lines to the file.
To permit the user saif
to execute any command as a root user:
permit saif as root
To permit any user from the :wheel
to execute any command as a root user.
permit :wheel as root
Don’t ask for password for some times:
permit persist saif as root
Now unmount -R /mnt
remove the installation media and reboot
Install blackarch on top of arch linux
# Run https://blackarch.org/strap.sh as root and follow the instructions.
curl -O https://blackarch.org/strap.sh
# Verify the SHA1 sum
echo 8bfe5a569ba7d3b055077a4e5ceada94119cccef strap.sh | sha1sum -c
# Set execute bit
chmod +x strap.sh
# Run strap.sh
sudo ./strap.sh
Enable multilib:
To enable multilib repository, uncomment the [multilib]
section in /etc/pacman.conf
.
vim /etc/pacman.conf
Find
[multilib]
Include = /etc/pacman.d/mirrorlist
and uncomment the section.
Now synchronize the packages and upgrade the system.
sudo pacman -Syu
- Tip: Run
pacman -Sl multilib
to list all packages in the multilib repository. 32-bit library package names begin with lib32-.
You may now install tools from the blackarch repository.
To list all of the available tools, run
sudo pacman -Sgg | grep blackarch | cut -d' ' -f2 | sort -u
To install all of the tools, run
sudo pacman -S blackarch
To install a category of tools, run
sudo pacman -S blackarch-<category>
To see the blackarch categories, run
sudo pacman -Sg | grep blackarch
- Note - it maybe be necessary to overwrite certain packages when installing blackarch tools. If you experience “failed to commit transaction” errors, use the –needed and –overwrite switches
For example:
sudo pacman -Syyu --needed blackarch --overwrite='*'