This guide will show step-by-step how to Install Arch Linux on UEFI mode.
- Bootable Flash Drive
- BIOS
- Pre installation
- Set Keyboard Layout
- Check boot mode
- Update System Clock
- Internet Connection
- DHCP
- Wi-Fi
- Wired Connection
- Partitioning
- Create Partitions
- Format Partitions
- Mount the file system
- Installation
- Select Mirror
- Install Base Packages
- Generate fstab
- Chroot
- Check pacman keys
- Configure System
- Locale and Language
- Keymap
- Timezone
- Hardware Clock
- Network
- Hostname
- Nameservers
- Firewall
- Blacklists
- No Beep
- No Watchdog
- Initramfs
- Set-up Wi-Fi
- Bootloader
- Root password
- Xorg
- Video
- Audio
- Users
- Reboot
- Locale and Language
- Post installation
- Window Manager
- Network Manager and services
- Extras
- Set-up TTF Fonts
- Bluetooth Headphone
First of all, you need the Arch Linux image, that can be downloaded from the Official Website. After that, you should create the bootable flash drive with the Arch Linux image.
If you're on a GNU/linux distribution, you can use the dd command for it. Like:
$ dd bs=4M if=/path/to/archlinux.iso of=/dev/sdx status=progress oflag=sync && syncNote that you need to update the
of=/dev/sdxwith your USB device location (it can be discovered with thelsblkcommand).
Otherwise, if you're on Windows, you can follow this tutorial.
We'll install Arch on UEFI mode, so you should enable the UEFI mode and disable the secure boot option on your BIOS system. (Also remember to change the boot order to boot through your USB device).
https://help.uaudio.com/hc/en-us/articles/213195423-How-To-Disable-Fast-Startup-in-Windows-10
I'm presuming that you're already in the Arch Linux zsh shell prompt.
To check if the UEFI mode is enabled, run:
# ls /sys/firmware/efi/efivarsIf the directory does not exists, the system may be booted in BIOS (not UEFI).
Ensures that the system clock is accurate.
# timedatectl set-ntp trueFirst, test if you alredy have internet connection, so run:
# ping -c 2 google.comIf you're not connected, follow one of these steps:
This option is automatically started. Run:
# dhcpcdRun the following command and connect to your wi-fi network.
# wifi-menu -o
The
-ooption is to hide your password by using the "obscure" method
Warning: Make sure the DHCP is deactivated by running systemctl stop dhcpcd.service
-
Find the network interface name
# ip linkThe response will be something like:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: enp2s0f0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000 link/ether 00:11:25:31:69:20 brd ff:ff:ff:ff:ff:ff 3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT qlen 1000 link/ether 01:02:03:04:05:06 brd ff:ff:ff:ff:ff:ff -
Activate Network interface
Using the
enp2s0f0for example:# ip link set enp2s0f0 up -
Add IP addresses
The command to do that is
ip addr add [ip_address]/[mask] dev [interface]applying to our example:# ip addr add 192.168.1.2/24 dev enp2s0f0 -
Add the Gateway
The command is
ip route add default via [gateway]then:# ip route add default via 192.168.1.1 -
Change DNS
Using the Google DNS, open the file
/etc/resolv.conf(you can usenanoorvito do that) and write down these lines:nameserver 1.1.1.1 nameserver 8.8.8.8 nameserver 8.8.4.4
After that, test your internet connection again with the ping command.
First, define your partitions size. There's no rules about this process.
Tip: If you use a SSD drive, it's recommended to leave 25% of his storage free. More info here.
My SSD has 256GB of storage. I want to have Dual-Boot with Windows10. If Windows was installed first, then you could see it's partitions. For that example, I have 4 Windows partitions already created:
(in my case, I'll work with /dev/nvme0n1 disk. Use fdisk -l /dev/nvme0n1 to list partitions)
| Name | Size | Type |
|---|---|---|
| nvme0n1p1 | 499M | Windows recovery environment |
| nvme0n1p2 | 100M | EFI System |
| nvme0n1p3 | 16M | Microsoft Reserved |
| nvme0n1p3 | 97.1 | Microsoft Basic Data |
100GB were allocated for Windows in total
EFI partition was created by Windows, so we don't need to care about it. We need to create additional partitions for Linux installation.
| Name | Mount | Size | Type |
|---|---|---|---|
| nvme0n1p5 | swap |
1G | Linux Swap |
| nvme0n1p6 | / |
32G | Linux Root x86-64 (Ext4) |
| nvme0n1p7 | /home |
Remaining Space | Linux Home (Ext4) |
Look at partitioning layout examples: https://wiki.archlinux.org/index.php/partitioning#Example_layouts
Use fdisk to create partitions.
To create partitions, I'll use gdisk since to work on UEFI mode we need GPT partitions.
First, list partitions (Informational only) with the following command
# fdisk -l /dev/nvme0n1Here's a table with some handy gdisk commands
| Command | Description |
|---|---|
| p | Print partitions table |
| n | Add a new partition |
| d | Delete a partition |
| w | Write table to disk and exit |
| l | List known partition types |
| t | Change a partition type |
| m | Help |
-
Enter in the interactive menu
# fdisk /dev/nvme0n1 -
Create boot partition (If not Dual-Boot)
- Type
nto create a new partition - Partition Number: default (return)
- First Sector: default
- Last Sector:
+512M - Type:
1- EFI System
- Type
-
Create root partition
- Type
nto create a new partition - Partition Number: default
- First Sector: default
- Last Sector:
+32G - Type:
24- Linux Root (x86-64)
- Type
-
Create swap partition
- Type
nto create a new partition - Partition Number: default
- First Sector: default
- Last Sector:
+1G - Type:
19- Linux Swap
- Type
-
Create home partition
- Type
nto create a new partition - Partition Number: default
- First Sector: default
- Last Sector: default
- Type:
28- Linux Home
- Type
-
Save changes with
w
Once the partitions have been created, each (except swap) should be formatted with an appropriated file system. So run:
# mkfs.ext4 /dev/nvme0n1p6 #-- root partition
# mkfs.ext4 /dev/nvme0n1p7 #-- home partitionIf not Dual Boot format partition for EFI boot
# mkfs.fat -F32 -n BOOT /dev/nvme0n1p2 #-- boot partitionThe process for swap partition is slight different:
# mkswap -L swap /dev/nvme0n1p5
# swapon /dev/nvme0n1p5To check if the swap partition is working, run
swapon -sorfree -h.
-
Mount root partition:
# mount /dev/nvme0n1p6 /mnt -
Mount home partition:
# mkdir -p /mnt/home # mount /dev/nvme0n1p6 /mnt/home
-
Mount boot partition: (to use
grub-installlater)# mkdir -p /mnt/boot # mount /dev/nvme0n1p2 /mnt/boot
Now we'll install arch on disk
Before installation, is recommended to select the best mirror servers.
So open the file /etc/pacman.d/mirrorlist (again, you can use nano or vi to do that) and move the best mirror to the top of the file.
Tip: That link generates a mirror list based on your location, you can use them as reference.
Now that the mirrors are already set, use pacstrap to install the base package group:
# pacstrap /mnt base base-devel linux linux-firmwareNow you should generate the fstab with the genfstab script:
# genfstab -p /mnt >> /mnt/etc/fstabOptional: You can add
noatime,commit=60,barrier=0to the generatedfstabfile (on root and home partitions) to increase IO performance. https://wiki.archlinux.org/index.php/ext4#Improving_performance
Now, we'll change root into the new system
# arch-chroot /mnt# pacman-key --init
# pacman-key --populate archlinuxpacman -S neovim man-db man-pages texinfo elinksNow, if you want to install some additional package, do it with
pacman -S <package_name>
Follow: https://wiki.archlinux.org/index.php/Installation_guide#Time_zone
Follow: https://wiki.archlinux.org/index.php/Installation_guide#Localization
# echo myhostname > /etc/hostnameChange
myhostnameto your hostname (Computer Name)
After that, open the file /etc/hosts and write (remember to change the myhostname to your own)
# IPv4 Hosts
127.0.0.1 localhost myhostname
# Machine FQDN
127.0.1.1 myhostname.localdomain myhostname
# IPv6 Hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Write to file /etc/modules-load.d/firewall.conf:
# iptables modules to run on boot
ip_tables
#Enable conntrack only if NAT used
#nf_conntrack_netbios_ns
#nf_conntrack
Warning: this part is optional.
To avoid the beep on boot, Write to file /etc/modprobe.d/nobeep.conf:
# Dont run pcpkr module on boot
blacklist pcspkr
If you don't want a watchdog service running, write to file /etc/modprobe.d/nowatchdog.conf
blacklist iTCO_wdt
https://wiki.archlinux.org/index.php/Installation_guide#Initramfs
Creating a new initramfs is usually not required, because mkinitcpio was run on installation of the kernel package with pacstrap.
# mkinitcpio -p linuxUsing systemd-boot to install EFI boot manager:
# bootctl --path=/boot installThen add following content to /boot/loader/entries/arch.conf
title Arch Linux
linux /vmlinuz-linux
initrd /intel-ucode.img
initrd /initramfs-linux.img
options root=UUID=ROOT_PART_UUID rw
ROOT_PART_UUID must be replaced with UUID found using blkid or lsblk -f (More here: https://wiki.archlinux.org/index.php/Persistent_block_device_naming)
and following content to /boot/loader/loader.conf
timeout 5
default arch
# passwdhttps://wiki.archlinux.org/index.php/Network_configuration
Select network manager: https://wiki.archlinux.org/index.php/Network_configuration#Network_managers
Install required packages with pacman
# pacman -S wpa_supplicantSee: https://bbs.archlinux.org/viewtopic.php?pid=1393759#p1393759
Follow: https://wiki.archlinux.org/index.php/Systemd-resolved
This assumes that your NIC is wlp2s0, your SSID is MyNetwork, and the password is SuperSecretPassphrase.
You need to create a wpa_supplicant-wlp2s0.conf. So use wpa_passphrase to generate one:
# set +o history
# wpa_passphrase MyNetwork SuperSecretPassphrase > /etc/wpa_supplicant/wpa_supplicant-wlp2s0.conf
# set -o historyEnable it so that it runs on boot:
# systemctl enable wpa_supplicant@wlp2s0Now make networkd configuration files.
File /etc/systemd/network/20-wired.network:
[Match]
Name=enp1s0
[Network]
DHCP=yes
[DHCP]
RouteMetric=10
File /etc/systemd/network/25-wireless.network:
[Match]
Name=wlp2s0
[Network]
DHCP=yes
[DHCP]
RouteMetric=20
Now ensure that systemd-networkd.service is enabled.
# systemctl enable systemd-networkd.serviceIt should be working after reboot.
https://bbs.archlinux.org/viewtopic.php?pid=1393759#p1393759
Exit chroot environment by pressing Ctrl + D or typing exit
Unmount system mount points:
# umount -R /mntReboot system:
# rebootRemember to remove USB stick on reboot
There are basically three layers that can be included in the Linux desktop:
X Windows – This is the foundation that allows for graphic elements to be drawn on the display. X Windows builds the primitive framework that allows moving of windows, interactions with keyboard and mouse, and draws windows. This is required for any graphical desktop.
Window Manager – The Window Manager is the piece of the puzzle that controls the placement and appearance of windows. Window Managers include: Enlightenment, Afterstep, FVWM, Fluxbox, IceWM, etc. Requires X Windows but not a desktop environment.
Desktop Environment – This is where it begins to get a little fuzzy for some. A Desktop Environment includes a Window Manager but builds upon it. The Desktop Environment typically is a far more fully integrated system than a Window Manager. Requires both X Windows and a Window Manager. Examples of desktop environments are GNOME, KDE, Cinnamon, Xfce among others
See: https://askubuntu.com/questions/18078/what-is-the-difference-between-a-desktop-environment-and-a-window-manager See: https://www.ghacks.net/2008/12/09/get-to-know-linux-desktop-environment-vs-window-manager/
Install Xorg Server: (use default options)
# pacman -S xorg-serverDefine your keyboard layout on /etc/X11/xorg.conf.d/10-keyboard.conf file:
Section "InputClass"
Identifier "keyboard default"
MatchIsKeyboard "yes"
Option "XkbLayout" "br"
Option "XkbVariant" "abnt2"
EndSection
Install your GPU driver
# pacman -S xf86-video-vesaInstall audio driver
# pacman -S alsa-utilsConfigure and save:
# alsamixer
# alsactl storeInstall sudo package
# pacman -S sudoConfigure sudo (uses vim as default editor) by running visudo and uncommenting the line:
## Uncomment to allow members of group wheel to execute any command
%wheel ALL=(ALL) ALL
Now we're going to add a new user by running: (change myuser to your username)
# useradd -m -G wheel -s /bin/zsh myuserChange the new user passord:
# passwd myuserNow you're on your successfull Arch Linux installation.
Login with your user and follow the next steps.
Now We're gonna install the Window Manager.
I'll show the steps to install Gnome.
First of all, run the installation command with pacman:
$ sudo pacman -S gnome gnome-extraWhen the installation finishes, enable gdm to be started with system on boot:
$ sudo systemctl enable gdm.serviceNow we'll remove the previously enabled service from netctl and the wifi-menu settings.
First ensures that the NetworkManager package is installed:
$ sudo pacman -S networkmanagerEnable and start NetworkManager service:
$ sudo systemctl enable NetworkManager.service
$ sudo systemctl start NetworkManager.serviceGo to /etc/netctl folder and see the connection files (the ones that starts with something like wlp1s0...)
Disable the netctl service that you've been enable previously:
$ sudo netctl diable wlp1s0-MyWiFiThen, remove all /etc/netctl folder and remove your connection file (the one that starts with something like wlp1s0...)
$ sudo rm wlp1s0... #-- replace with you wifi connection fileNow you can reboot the system (by running reboot) and everyting should be working fine.
Follow this tutorial
To connect the headphone:
- Install required packages:
$ sudo pacman -S pulseaudio pulseaudio-bluetooth pavucontrol bluez-utils
- Edit
/etc/pulse/system.paand add:load-module module-bluez5-device load-module module-bluez5-discover
- For GNOME users:
$ sudo mkdir -p ~gdm/.config/systemd/user $ ln -s /dev/null ~gdm/.config/systemd/user/pulseaudio.socket
- Connect to bluetooth device
$ bluetoothctl # power on # agent on # default-agent # scan on # pair HEADPHONE_MAC # trust HEADPHONE_MAC # connect HEADPHONE_MAC # quit
To auto switch to A2DP mode:
- Edit
/etc/pulse/default.paand add:.ifexists module-bluetooth-discover.so load-module module-bluetooth-discover load-module module-switch-on-connect # Add this line .endif - Modify (or create)
/etc/bluetooth/audio.confto auto select AD2P profile:[General] Disable=Headset - Reboot PC to apply changes
- https://wiki.archlinux.org/index.php/installation_guide
- https://forum.archlinux-br.org/viewtopic.php?id=4453
- https://itsfoss.com/install-arch-linux/
- https://www.ostechnix.com/install-arch-linux-latest-version/
- https://github.com/jieverson/dotfiles/wiki/arch-linux-for-dummies
- http://ticki.github.io/blog/setting-up-archlinux-on-a-lenovo-yoga/