[Arch]Archlinux basic installation - UEFI mode

Posted by alpine on Tue, 21 Sep 2021 22:01:12 +0200

  1. Check whether the motherboard is in UEFI mode
ls /sys/firmware/efi/efivars
  1. Connect network
  1. Test whether the connection is successful
ping baidu.com
  1. Ensure that the system time is accurate
timedatectl set-ntp true
  1. View hard disk partitions
fdisk -l
  1. Hard disk partition
    Partition using cfdisk tool
cfdisk /dev/sda
  • After entering the tool, select gpt
  • Partition recommendation
    EFI file system 512M
    linux swap greater than 512M
    Space left in root directory
    EFI partition type (Tye) select the first EFI System
    linux swap partition type (Tye) select linux swap
    The root partition type (Tye) is linux filesystem
  • When the partition is completed, select Write. Here, you must enter yes and Quit
  • Check the partition again
fdisk -l
  • Format partition:

EFI partition format is f32

mkfs.fat -F32 /dev/sda1

The partition format of linux filesystem is ext4

mkfs.ext4 /dev/sda3
  • swap partition settings

Swap space initialization

mkswap /dev/sda2

Enable swap space

swapon /dev/sda2
  1. Mount file
  • Root directory file (linux filesystem)
mount /dev/sda3 /mnt
  • Create additional mount points to the appropriate partition
mkdir /mnt/boot

Create the boot file in the root directory and hang it in sda1 (that is, hang the EFI file in sda1)

mount /dev/sda1 /mnt/boot
  1. Modify domestic image
vim /etc/pacman.d/mirrorlist

Two domestic images are recommended here

  1. Install the basic software package, linux kernel and firmware of conventional hardware
pacstrap /mnt base base-devel linux linux-firmware vim dhcpcd
  1. Generate fstab file
genfstab -U /mnt >> /mnt/etc/fstab
  1. change root to the new system
arch-chroot /mnt
  1. Set time zone
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
  1. Synchronization time
hwclock --systohc
  1. localization
vim /etc/locale.gen

Remove the comments from the desired area

en_US.UTF-8 UTF-8
zh_CN.UTF-8 UTF-8

Generate locale information


Create locale.conf and edit it

vim /etc/locale.conf



Setting Chinese is not recommended here, which will cause TTY garbled code
15. Create the hostname file and add the hostname

echo "host name" >> /etc/hostname

Add information to hosts localhost
::1 localhost host name.localdomain host name
  1. Set root password
  1. Install motherboard microcode (for intel users only)

intel processor user installation

pacman -S intel-ucode
  1. The hard disk has dual systems that need to be installed (only arch does not need to be installed)
pacman -S os-prober
  1. Install startup management tools
pacman -S grub efibootmgr

Generate GRUB EFI

grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
  1. Generate startup file
grub-mkconfig -o /boot/grub/grub.cfg
  1. Notebooks need to be installed
pacman -S iw wpa_supplicant dialog netctl
  1. Turn on the network
systemctl enable dhcpcd
  1. Start network
systemctl start dhcpcd
  1. Exit installation


  1. Manually unmount the mounted partition
umount -R /mnt
  1. reboot after installation
  2. Create a sudo user
useradd -m user name
  1. Set user password
passwd user name
  1. Install KDE Plasma desktop
  • Xorg group

  • KDE Plasma desktop environment

  • Session of Wayland KDE Plasma

  • KDE application group (including KDE specific applications: Dolphin manager and other useful applications).

pacman -S xorg plasma plasma-wayland-session kde-applications 

Start the display manager and network manager services after installation

systemctl enable sddm.service

systemctl enable NetworkManager.service 
  1. Restart the computer after installation

Topics: Linux vim arch