ArchLinux:Installation
lastmod 2020-12-03created 2020-03-0853 edits
Notes on how to install Arch Linux.
USB media
In macOS
First, you need to identify the USB device. Open /Applications/Utilities/Terminal and list all storage devices with the command:
Your USB device will appear as something like /dev/disk2 (external, physical). Verify that this is the device you want to erase by checking its name and size and then use its identifier for the commands below instead of /dev/diskX.
A USB device is normally auto-mounted in macOS, and you have to unmount (not eject) it before block-writing to it with dd. In Terminal, do:
Now copy the ISO image file to the device. The dd command is similar to its Linux counterpart, but notice the 'r' before 'disk' for raw mode which makes the transfer much faster:
| Note |
| BSD-derived [[dd], which includes macOS's default dd, uses lower-case |
This command will run silently. To view progress, send SIGINFO by pressing Ctrl+t. Note diskX here should not include the s1 suffix, or else the USB device will only be bootable in UEFI mode and not legacy. After completion, macOS may complain that "The disk you inserted was not readable by this computer". Select 'Ignore'. The USB device will be bootable.
USB Booting
For reference, the installation was done on an ACER Swift3 SF314-42 R7 Scene Stealer.
After entering the BIOS setup page with F2, the settings were as follows.
- Boot > Secure Boot > DIsabled
- Boot priority order:
- USB CDROM
- USB HDD
- UEFI_SHELL
Installation
Check UEFI.
Wireless network setup
Connect to the network using iwd. See that page for related information.
$ systemctl start iwd.service
$ iwctl
[iwd]# device list
[iwd]# station <device-name> scan
[iwd]# station <device-name> get-networks
[iwd]# station <device-name> connect <ssid>
## or
[iwd]# station <device-name> connect-hidden <ssid>
[iwd]# station <device-name> show
[iwd]# quit
$ ifconfig
Setting the system time
Set the time by referring to the timedatectl page. In short,
Disk partitioning
See Disk partitioning. For an example, see DiskPartitioning:Example:UEFI_with_GPT.
Formatting the partitions
Once the partitions are created, each one must be formatted with an appropriate file system. If the partitions are laid out as in DiskPartitioning:Example:UEFI_with_GPT, format them as follows.
To avoid potential problems with other operating systems, format the EFI partition as FAT32. See Unified Extensible Firmware Interface#Format the partition for details.
Format the partition that will hold the OS data as ext4 as follows.
If you created a swap partition, initialize it with mkswap and swapon.
Mounting the partitions
Mount the root partition on /mnt.
Mount the system partition on /mnt/boot.
Later, genfstab will be used to detect the mounted file systems and swap space.
Installing
Mirror servers can be edited in /etc/pacman.d/mirrorlist. On the live system, all servers are selected and sorted by their sync status and speed at the time the installation image was built. Servers higher in the list are given priority. Because pacstrap copies this mirror list file to the new system during installation, it is worth editing it properly.
Install the base, linux, and linux-firmware package groups with pacstrap.
Additional packages can be appended as extra arguments. Alternatively, they can be installed with the pacman command after the chroot step.
System configuration
fstab
Generate the fstab file with the following command. Use the -U option to use UUIDs, or the -L option for labels.
Check the generated /mnt/etc/fstab file.
chroot
Change ROOT to the new system.
Installing additional packages
Install a few handy packages with pacman.
Before installing, update the repository information.
man for package documentation:
sudo for administrator privileges:
iwd for wireless network connections:
Time zone
Set the time zone. Use the /usr/share/zoneinfo/지역명/도시명 file (region/city). For Asia/Seoul, apply it as follows.
Set the hardware clock to UTC using hwclock.
Check that the /etc/adjtime file was created. See hwclock(8).
Localization
In the /etc/locale.gen file, find en_US.UTF-8 UTF-8 and any other localization you need, uncomment them, and run locale-gen.
Language settings
Set the LANG variable, which controls the system-wide language setting.
See locale.conf(5).
Keyboard layout
Unless configured otherwise, the default is us. The list of available layouts can be checked as follows.
To set the keymap, add the KEYMAP environment variable to the /etc/vconsole.conf file.
Changing the layout
The layout can be changed with loadkeys(1). For example, for a German keyboard layout:
Console fonts are in the /usr/share/kbd/consolefonts/ directory. They can be changed with setfont(8).
Hostname
Edit hostname(5). (It seems hostnamectl(1) can be used.. <- needs checking)
Then update hosts(5).
Update the list as follows.
127.0.0.1 localhost.localdomain localhost
::1 localhost.localdomain localhost
127.0.1.1 호스트명.localdomain 호스트명
See Hostname.
Administrator setup
Set the administrator password.
Configure sudo using visudo.
Find the following section.
Then uncomment it as follows and save.
User setup
Add a new user.
The options mean the following.
-
-m: create a home directory named after the user. -
-g [그룹명](group name): lowercasegmeans the primary group. The list of groups is in/etc/group. -
-G: set additional groups.
-s [쉘 실행파일 경로] (shell executable path): choose the default shell program to use Set the user's password.
Installing the boot loader
Install the GRUB and efibootmgr packages.
Install GRUB.
If the installation succeeds, the following message is printed.
You can change the default settings by checking the /etc/default/grub file. The boot file is generated from this file.
If it is generated successfully, the following message is printed.
Generating grub configuration file ...
Found linux image: /boost/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot: initramfs-linux-fallback.img
done
Exit and reboot
Exit the chroot environment.
Unmount the mounted devices.
Or add the Recursive option as below.
Then reboot.
Wireless network configuration
For DNS management, start systemd-resolved, which iwd uses by default.
Edit /etc/iwd/main.conf, the configuration file of iwd, as follows.
Then start iwd.
Once you complete the connection with iwctl as above, the configuration file for that SSID is saved in the /var/lib/iwd/ directory.
Check that an IP was assigned correctly with the command below.
Then check that the external network connection works.
Recommendations
For further tasks such as system administration guidance, GUI environment setup, sound, and touchpad, see the general recommendations.
Also see the list of applications that may be of interest.
Next: ArchLinux:Setup
See also
Favorite site
- [Recommended] Installation guide (Korean) - ArchWiki
- How to Install Arch Linux (Step by Step Guide)
- [Recommended] Arch Linux installation guide - W. H. Jeon 1
- Github - nw2190/Arch_Install - Arch Linux Installation Guide for Dell XPS 13 (9380) (2019)
- Dell XPS 13 (9370) - ArchWiki
- SOLUTION: Switch Windows 10 from RAID/IDE to AHCI operation
- Arch Linux Installation Guide
References
-
Arch_Linux_Installation_Guide-W._H._Jeon.pdf ↩