System Installation
If you haven’t installed Arch Linux yet, continue reading. It is recommended to start from scratch since the dotfiles are tightly integrated with how my system is set up. If you know what you are doing, you might want to skip to the manual or automatic customization steps.
I recommend that you read the Arch Linux Wiki’s installation guide instead since it is more updated and accurate than a guide that is maintained by one hobbyist like me. I also recommend reading arch.d3sox.me if you have trouble understanding the wiki.
Pre-Installation
Preparing the Installation Medium
I assume that you know how to boot into the Arch Linux ISO. You can download the ISO from their website, and use Ventoy to boot into your USB Flash Drive.
After this point, I assume that you are now in the live ArchISO system.
Preparing the Console
If you are not using a US keyboard, you might want to change your keyboard layout.
Verifying Internet Connection
Internet connection via Ethernet should be working out of the box. If you are using a wireless connection, perform the following commands:
If you are having problems turning on your wireless NIC, make sure that it is not being soft-blocked by
rfkill
.
To make sure that you have an internet connection, ping the Arch Linux website.
Setting Up Time and Date
Make sure that the time and date is synchronized.
Check if The System Booted in UEFI
If the directory does not exist, you are in BIOS mode. It is most likely that you want to use UEFI, so check the wiki to know how to boot into UEFI mode.
Storage Preparation
Partitioning and Mounting the Disks
List all block devices by running the following command:
In my case, my main storage device is located at /dev/sda
. So we run the following command: (Your device might have a different name)
Partition the device following the structure shown in Environment > Disk Partitions. If you have different needs, you can see more examples in the Arch Linux Wiki and d3sox’s guide. After saving the changes made by fdisk
, create the filesystems.
Regarding Btrfs Compression
The compression level of zstd may vary, depending on your storage type. For slower devices such as HDDs, it is better to optimize the file size so that the system will spend less time reading and writing. Meanwhile, the added compression/decompression time is (theoretically) slowing down I/O for faster devices.1
Basically, set
compress-force=zstd:N
…
- Within
2-5
if you have a rotating storage device- To
2
if you have a SATA SSD- To
1
if you have an NVMe SSDDepending on your needs, you can set the compression levels higher if storage space is more important or lower if latency or bandwidth is more important.
Installing Arch Linux
Rank the Mirrors
Use reflector to rank the mirror servers.
Perform the Base Installation
Use the pacstrap
command to install Arch Linux into your system.
WARNING
To ensure system stability, append the microcode package for your CPU to the following command:
amd-ucode
for AMD CPUsintel-ucode
for Intel CPUs
Append more package names as needed. For example, my laptop has Broadcom wireless devices so I have to install broadcom-wl
as well. This command may take a while to complete.
Generate fstab
Generate an fstab file by running either of the following commands:
Check the
/mnt/etc/fstab
file for any errors.
Chroot into Your New Arch Linux System
Configure Pacman
Enable multilib
Repository
Uncomment the following lines to make 32-bit libraries available to download.
Enable Parallel Downloads
Uncomment the following line to enable parallel downloading of files. You can change the value to whatever you like.
Other Stuff
Uncomment/Add the following lines under Misc options
:
Color
ILoveCandy
VerbosePkgLists
Post-Configuration
After editing the configuration file, you may now save and close it. Run pacman -Syu
to update the repositories.
Add zram
Instead of having a swap partition, we are going to use zram instead.
After installation, create/edit /etc/systemd/zram-generator.conf
and replace its contents with the following:
ZRAM Backing Device
If you opted for using ZRAM’s writeback feature, get the partition UUID of your backing device partition (
/dev/sdaX
) by looking at the results ofls -lAh /dev/disk/by-partuuid
, and add the following line in/etc/systemd/zram-generator.conf
, under[zram0]
:
We can also optimize our zram
configuration by creating /etc/sysctl.d/99-vm-zram-parameters.conf
and adding the following in the file:
vm.swappiness = 180
vm.watermark_boost_factor = 0
vm.watermark_scale_factor = 125
vm.page-cluster = 0
Installing The Graphics Driver
First, install Mesa and Vulkan graphics drivers.
Depending on your graphics card, run the appropriate command to install the graphics drivers needed:
Manufacturer | Command |
---|---|
AMD (New) | pacman -S xf86-video-amdgpu libva-mesa-driver lib32-libva-mesa-driver mesa-vdpau lib32-mesa-vdpau libva-vdpau-driver lib32-libva-vdpau-driver vulkan-radeon lib32-vulkan-radeon |
AMD (Old) | pacman -S xf86-video-ati libva-mesa-driver lib32-libva-mesa-driver mesa-vdpau lib32-mesa-vdpau libva-vdpau-driver lib32-libva-vdpau-driver vulkan-radeon lib32-vulkan-radeon |
Intel [See warning below] | pacman -S xf86-video-intel vulkan-intel |
Nvidia (Nouveau) | pacman -S xf86-video-nouveau nvidia-utils lib32-nvidia-utils libvdpau lib32-libvdpau |
Virtual Machine (Hyper-V) | pacman -S xf86-video-fbdev |
Virtual Machine (Others) | pacman -S xf86-video-vmware |
Troubleshooting
Intel
According to Arch Linux Wiki > Intel Graphics > Installation, there are multiple problems when installing
xf86-video-intel
so you might want to not install the package.NVIDIA
If you are having problems, read Arch Linux Wiki > NVIDIA.
initramfs
Setup
Now, we need to edit our initial ram disk by running nano /etc/mkinitcpio.conf
. Inside the parenthesis of MODULES=()
, add the following (separated by a space):
btrfs
andext4
, since we are using Btrfs and EXT4 as our filesystems.amdgpu
if you are running the new AMD GPU driver,i915
if Intel, ornvidia nvidia_modeset nvidia_uvm nvidia_drm
if you use proprietary NVIDIA drivers.
As an example, my machine has a built-in Intel GPU so I have the following:
If you are running proprietary NVIDIA drivers, remove
kms
insideHOOKS=()
.
After editing, we run mkinitcpio -P
to process all preset files.
Install Bootloader
In this step, I assume that you are installing on a UEFI system. Otherwise, check d3sox for more information.
GRUB OS Prober
If you want to automatically detect other operating systems, run
nano /etc/default/grub
and add/uncomment the following line:
NOTE
If you forgot to perform
grub-mkconfig
and shut down/reboot the system instead (which I totally did not do while installing Arch), just boot into your live USB again, mount the partitions, andchroot
into your system.
Setup Hostname
<YOUR_HOSTNAME>
will be the name of your machine. Change it to whatever you like, but following RFC1178 is recommended.
When the text editor opens, add the following to the file and save:
Setting Up Locale
Uncomment the languages that you plan to use in /etc/locale.gen
and then generate the locales.
Update the Time
Setting Up Users
It is recommended to use strong passwords for your user accounts.
Set Root Password
Add A Non-Root User Account
A common security practice is that you should not use the root account unless needed and you know that it is safe to run. To create a non-root user, run the commands below and change the parameters to the values you desire.
For more information, visit the Arch wiki.
To enable sudo
in the newly-created account, run the following command:
And uncomment the following line to allow members of the group wheel
to execute any command:
Enable Networking-Related Services
First, create or edit /etc/NetworkManager/conf.d/wifi_backend.conf
and insert the following configuration:
Then, enable the NetworkManager
service.
More information: Arch Linux Wiki > Wireless
Enable Other System Services
Edit /etc/xdg/reflector/reflector.conf
and replace its contents with the following:
--latest 10
--age 18
--protocol https,rsync
--sort rate
--save /etc/pacman.d/mirrorlist
Lastly, enable the services:
Reboot
- Previous: Environment
- Next: Automatic Customization