User:Erkexzcx
This is my unofficial Arch Linux installation guide for very beginners with basic Linux/Computing knowledge, who wish to start using Arch Linux, but finds it impossible to install. Things to note:
- Tutorial does not go much into the details, so consider this tutorial only as a starting point.
- This is UEFI based Arch Linux installation. If you are installing in BIOS mode - your partitioning and grub set-up will be different.
Basic Arch Linux installation
Understanding the installation
- Boot up Arch Linux from USB stick (live mode).
- Set up internet connectivity.
- Set up partitions.
- Format partitions.
- Mount partitions.
- Install Arch Linux to those mounted partitions.
- Generate FSTAB partitions scheme (so it knows how to mount everything before booting up)
- Chroot (AKA "login") to on-disk Arch Linux installation from live mode.
- Basic configuration - timezone, locale, hostname, root user password
- Set up GRUB bootloader (it boots your system)
- Install some required (common) packages.
At the end of this page I will also give few tips on how to further set up complete desktop on this basic arch linux installation.
Internet connectivity
Connect to the Internet
Use command ping www.google.com
to confirm working internet connection.
Ethernet (cable)
In most cases, it should work out of the box. If it doesn't work, run dhcpcd
and wait about 15-30 seconds and internet should be working.
Wireless (WiFi)
Execute command wifi-menu
to use automated step by step program to connect to WiFi. Follow the instructions and you should be good to go.
wifi-menu wlpxxxxxxxxx
instead, where wlpxxxxxxxxx
can be found with command iw dev
.Partitioning
Use lsblk
and lsblk -f
to see the information about your detected hard drives and their partitions.
Destroy all partitions
This completely destroys all data on your /dev/sda
hard drive:
# sgdisk --zap-all /dev/sda
Create partitions
Create 2 partition on your hard drive - one is for EFI installation, second is for Arch Linux installation. Type command cgdisk /dev/sda
to enter interactive CLI menu.
First, delete all the partitions (if any).
Then create new partition, first sector is default size suggested (just press enter), but for last sector, write 500M and hit enter. Partition code is ef00 and give any partition title you want (I suggest boot).
Then create new partition, first and last sector is default size suggested (just press enter). Partition code is also default (should be 8300) and give any partition title you want (I suggest linux).
At the end - write and quit. Use lsblk
and lsblk -f
to confirm your new partitions - first should be the size of approximately 500Mb and the other partition should be the rest of your hard drive size.
Format partitions
The new created partitions cannot be used until you format them.
Format the first EFI partition (the one that has about 500Mb space):
# mkfs.fat -F32 /dev/sda1
Then format second partition (the one that has the rest of hard drive space):
# mkfs.ext4 /dev/sda2
Mount partitions
Mount your prepared partitions so you can write some data (files) to them:
Mount first the second partition (the one that has the rest of your hard drive size) to /mnt directory :
# mount /dev/sda2 /mnt
Create boot
folder in mounted partition:
# mkdir /mnt/boot
And mount EFI partition to that boot
folder:
# mount /dev/sda1 /mnt/boot
Use lsblk
and lsblk -f
to confirm if you successfully mounted your partitions.
Install base Arch Linux system
Configure mirrors
First, go to /etc/pacman.d/
:
# cd /etc/pacman.d/
Then comment out every mirror in pacman mirrors list:
# sed -i 's/^Server/#Server/' mirrorlist
Then edit the file:
# nano mirrorlist
And uncomment only preferred mirrors (from the same or nearby countries). For example - uncommented mirror from Lithuania:
## Lithuania Server = http://mirrors.atviras.lt/archlinux/$repo/os/$arch
Install system
Perform this command to install base Arch Linux installation to /mnt
directory:
# pacstrap /mnt base base-devel
Create fstab
Fstab file contains what and how must be mounted before booting up. The good thing that there is an app to generate fstab file automatically for you:
# genfstab -U /mnt > /mnt/etc/fstab
You might also want to check if there is at least 2 lines containing information about partitions and their options:
# cat /mnt/etc/fstab
Enter the chroot mode
If you don't know what is chroot - think about logging into the installed system (AKA directory, where it is installed) with a root user, but without password. Everything you do in chroot mode will be permanent (will not be lost after reboot) and this procedure is usually used to fix existing systems when they no longer boots.
Enter Chroot mode with this command:
# arch-chroot /mnt
Set up locale
Set the US locale to your system.
Uncomment #en_US.UTF-8 UTF-8
to en_US.UTF-8 UTF-8
:
# nano /etc/locale.gen
Then apply changes to the system:
# locale-gen
Also write LANG=en_US.UTF-8
to /etc/locale.conf
file. This is needed for most of the programs:
# echo LANG=en_US.UTF-8 > /etc/locale.conf
Set up timezone
Just run this and follow the steps:
# tzselect
Then create symbolic link as per below command. Ensure you replace Zone and SubZone accordingly:
# ln -sf /usr/share/zoneinfo/Zone/SubZone /etc/localtime
Example: ln -sf /usr/share/zoneinfo/Europe/Vilnius /etc/localtime
Set the hardware clock
Execute this command:
# hwclock --systohc --utc
Set up datetime synchronisation
Enable systemd-timesyncd.service
so it starts on boot, synchronizes with NTP (time) servers and sets correct datetime:
# systemctl enable systemd-timesyncd.service
Set the hostname
Just give a name to your computer (without space). Example would be ARCHLINUX
:
# echo ARCHLINUX > /etc/hostname
Set the password
Use command passwd root
to change root user password.
Install kernel & firmware
Install default Arch Linux kernel and firmware with this command:
# pacman -S linux linux-firmware
Install bootloader
We will be using the most popular bootloader GRUB.
Install required packages for grub installation & configuration:
# pacman -S grub efibootmgr
Then install GRUB as a bootloader:
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
grub-install
says that errors occurred, then there is almost 100% chance your system will not boot.Then (re)generate GRUB config file:
# grub-mkconfig -o /boot/grub/grub.cfg
Install other required packages
Common networking applications
networkmanager
package and forget below packages.I believe these are must packages to have for fully functioning system. Later or sooner you will need them, so install:
# pacman -S net-tools wireless_tools dialog iw wpa_supplicant
Microcode updates
You might also want to install Microcode updates to your system:
# pacman -S intel-ucode # For Intel processors only # pacman -S amd-ucode # For AMD processors only
And do not forget to update grub configuration afterwards:
# grub-mkconfig -o /boot/grub/grub.cfg
Reboot
Exit the chroot mode:
# exit
Unmount partitions:
# umount /mnt/boot # umount /mnt
Reboot computer:
# reboot
And GRUB menu should show up when computer starts to boot. After it the system boots. Login will be user root and the password you set previously.
Make functioning desktop out of basic installation
Below are the steps to set up fully functioning desktop (GUI) on your PC/Laptop. Again - this is intended for beginners, therefore I am not going much into the details. Consider you already booted up to your installed Arch Linux system.
Understanding steps
- Connect to the internet (we will be downloading packages)
- Create regular user (and allow it to have root permissions)
- Set up graphics:
- Install Xorg video server (do not confuse - this is not a driver.)
- Install XFCE Desktop Environment
- Install LightDM login manager
- Install Pulseaudio audio server (allows to have audio)
- Install NetworkManager (manage internet connectivity)
- Finishing touches:
- Fix broken fonts (arch linux issue)
- Set up user directories (desktop, downloads, documents...)
- Install Web browser
- Install Trizen (install AUR packages with "pacman")
Note that most of the steps does not need to be performed in order! :)
Internet connectivity
Might be worth to look back at #Internet_connectivity, but I suggest using nmtui
. It's part of networkmanager
package. SystemD service NetworkManager
needs to be started.
Create regular user
Create user
First create new user with its home directory:
# useradd --create-home name
Then set user password:
# passwd name
Allow user to gain root access
Install sudo package:
# pacman -S sudo
Then using visudo
with nano
editor edit sudoers file:
# EDITOR=nano visudo
And uncomment line # %wheel ALL=(ALL) ALL
by changing to %wheel ALL=(ALL) ALL
.
Then add your regular user to wheel
group:
# gpasswd -a name wheel
Then save that file.
sudo
command, then uncomment # %wheel ALL=(ALL) NOPASSWD: ALL
instead.Install Xorg video server
# pacman -S xorg-server
Install XFCE desktop environment
# pacman -S xfce4 xfce4-goodies
Install NetworkManager
Install required packages with this command:
# pacman -S networkmanager network-manager-applet gnome-keyring
Then enable NetworkManager on boot:
# systemctl enable NetworkManager.service
And your system automatically connects to WiFi/Ethernet on boot. Going forward, usage from terminal:
$ nmtui
If you want to use from GUI - the network manager applet should appear in your XFCE panel.
Install LightDM login manager
# pacman -S lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings
Then enable lightdm on boot:
# systemctl enable lightdm.service
Install Pulseaudio packages
Install Pulseaudio audio server as well as few additional configuration packages (applications):
# pacman -S pulseaudio pulseaudio-alsa alsa-utils pavucontrol
Install browser
trizen
command (pacman wrapper}.# pacman -S firefox
Install monospace font
If you do not install this, then your terminal (in desktop environment) fonts will be broken (characters overlapping):
# pacman -S ttf-dejavu
Reboot
Reboot the system. After reboot you should see lightdm login manager - login using your created user to XFCE desktop environment.
pavucontrol
or alsa-mixer
to unmute/configure it. You might also need to add pulseaudio mixer applet to XFCE panel in order to change audio with a mouse.Install user directories
Install required package:
# pacman -S xdg-user-dirs
Then execute this command:
$ xdg-user-dirs-update
Then default directories in your home directory will be created (like Downloads or Desktop).
Install trizen
Trizen is pacman wrapper, which does everything that pacman does, but also adds extra functionality, so you can install packages from AUR and from official repositories with the same command.
Install it by executing below commands (P.S. This is how packages from AUR are being installed manually):
$ wget https://aur.archlinux.org/cgit/aur.git/snapshot/trizen.tar.gz # Download compressed AUR package script files $ tar -xvzf trizen.tar.gz # Decompress those files $ cd trizen # Enter decompressed folder $ makepkg -si # Download dependencies, build package and install it $ trizen # Execute once to generate config file
Example of installing Google Chrome from AUR:
$ trizen -S google-chrome
Example of installing Firefox from official repositories:
$ trizen -S firefox
trizen
command and at the end of output, you will see full path to config file.
Edit it and change line ask_for_retry => 0
to ask_for_retry => 1
and also change noedit => 0
to noedit => 1
.Further reading
I suggest reading these Arch Wiki pages to get familiar with Arch Linux and Arch Wiki:
- Find your hardware specific pages (e.g. ASUS_Zenbook_UX430/UX530 or ASUS_N550JV).
- Fan_speed_control - if you want to control fan speed. Also works on majority of laptops.
- Undervolting_CPU - Reduce heat and save power. Especially useful for laptop users.
- Improving_performance - Title says it all.
- Btrfs - Modern file system (EXT4 replacement), which has optimisations for SSD and other useful features.
- List_of_applications - Arch wiki have these kind of pages as well.
- And many more, depending on your needs...
xfce-theme-manager arc-gtk-theme arc-icon-theme
, then open XFCE Theme Manager GUI app and change the theme as well as icons. :) Reboot the system if some elements were not affected by theme.How to fix completely broken system
This is just a guidance on where to start looking for issues if they cannot be fixed from the same system (e.g. system not booting up).
First, boot up Arch Linux from USB stick (live mode).
Then connect to internet (if you need it) as per instructions in User:Erkexzcx#Internet_connectivity.
Then using lsblk
and lsblk -f
detect which partition is Arch Linux installation and which is EFI installation. EFI should be the size of about 500Mb. Let's assume dev/sda1
is EFI partition and dev/sda2
is linux installation:
# mount /dev/sda2 /mnt # Mount /dev/sda2 on /mnt directory # mount /dev/sda1 /mnt/boot # Mount /dev/sda1 on /mnt/boot directory # arch-chroot /mnt # Chroot to /mnt directory (our system is mounted to it)
Example 1
Lightdm is not starting or not allowing to login or access terminal.
Chroot to system, then it is likely a good idea to disable Lightdm (no longer start on boot):
# systemctl disable lightdm.service
Then reboot your system:
# exit # reboot
Example 2
Forgot user (or root user) password.
Chroot to system, then:
# passwd user
Then reboot your system:
# exit # reboot