1. The pre-installed

Make boot USB flash drive

Download the Arch Linux system image at archlinux.org/download/

Use Rufus to create a boot disk on Windows

Verify startup mode

Enter Live from USB and verify whether your machine is booting in UEFI or BIOS mode:

ls /sys/firmware/efi/efivars
Copy the code

To connect to the Internet

Wired network

A direct connection

dhcpcd
Copy the code

The wireless network

Arch Linux uses iwCTL for wireless network authentication by default.

  1. Enter iwctl in the terminal to enter the IWD prompt:

    iwctl
    Copy the code
  2. If you do not know the name of the wireless device, type device list in [iwd#] to find the network card device of the machine.

    [iwd]# device list
    Copy the code
  3. Searching wireless Networks

    [iwd]# station <device> scan
    Copy the code
  4. List all available wireless networks

    [iwd]# station <device> get-networks
    Copy the code
  5. Last connection network

    [iwd]# station <device> connect <wifi-SSID>
    Copy the code

Run ping archlinux.org to check whether the network connection is successful

Tips: refers to the available nic devices listed in the device List directive

Updating the System Time

timedatectl set-ntp true
Copy the code

Use timeDatectl status to verify the system time

Hard disk partition

When recognized by a live system, the disk is assigned a block device, such as /dev/sda, /dev/nvme0n1, or /dev/mmcblk0. To identify these devices, use LSBLK or fdisk. Viewing disk devices:

fdisk -l
Copy the code

Create partitions using fdisk or cfdisk. A partition must contain the following two points:

  • Contains a root partition/
  • Boot in UEFI mode: One EFI system partition.
The mount point Partition type Suggest size
/mnt/efi EFI system partition At least 260 m
[SWAP] Swap partition More than 512 m
/mnt The Root partition The remaining size

Formatted partition

Following the partitioning suggestions above, we need to format each partition with a corresponding file system.

Initialize the root partition directly using the ext4 filesystem:

mkfs.ext4 /dev/sda3
Copy the code

If you have also created a swap partition, you need to initialize it with mkswap.

mkswap /dev/sda2
swapon /dev/sda2
Copy the code

If your COMPUTER starts in UEFI mode, you also need to initialize the EFI system partition:

mkfs.fat -F32 /dev/sda1
Copy the code

Mount the partition

Mount root partition:

mount /dev/sda2 /mnt
Copy the code

Mount efI partitions

mkdir /mnt/efi
mount /dev/sda1 /mnt/efi
Copy the code

The swap partition does not need to be mounted. The swap partition is already enabled when it is formatted.

2. Installation

Select the mirror

Arch Linux all packages need to be downloaded from the image server. The mirror source list is in the /etc/pacman.d/ mirrorList file.

Install the necessary software packages

pacstrap /mnt base linux linux-firmware
Copy the code

Wait until the installation is complete. At this point, the system has been installed in theory, but it still cannot be used normally. You need to configure the system to use it normally.

Configure the system

Fstab Generates the Fstab file:

genfstab -U /mnt >> /mnt/etc/fstab
Copy the code

Chroot logs in to the installed system

arch-chroot /mnt
Copy the code

Time Zone Sets the system Time zone

ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
Copy the code

Run the hwclock command to generate /etc/adjtime:

hwclock --systohc
Copy the code

Install a text editor

Since there is no built-in text editor in the new version of the system, you need to install the text editor manually. Here is the vim installation:

pacman -S vim
Copy the code

If you don’t like Vim, you can install Nano, same as above.

Localization Settings

vim /etc/locale.gen
Copy the code

Uncomment the required locale. It is recommended to uncomment both en_US.utF-8 and zh_cn.utF-8.

Run:

locale-gen
Copy the code

Locale. conf file and set the LANG variable:

vim /etc/locale.conf
Copy the code
LANG=en_US.UTF-8
Copy the code

The network configuration

Create hostname file:

vim /etc/hostname
Copy the code
myhostname
Copy the code

Myhostname can be changed to the name you want.

Add the hosts

Vim/etc/hosts -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 127.0.0.1 localhost: : 1 localhost 127.0.0.1 myhostname. Localdomain myhostnameCopy the code

If your system has a permanent address, replace 127.0.0.1 above with this permanent address.

Setting the Root password

passwd
Copy the code

Install boot program

pacman -S grub efibootmgr
Copy the code

To install the boot program into the system:

grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=ArchLinux
Copy the code

Generate grub configuration file and enable Microcode update:

grub-mkconfig -o /boot/grub/grub.cfg
Copy the code

Install network management tools

So far, the system has been installed, but the new system does not include network management tools.

pacman -S iwd dhcpcd
Copy the code

After the installation is complete, exit chroot and restart:

exit

reboot
Copy the code

Configuration after installation

To connect to the Internet

Before connecting to the network, you need to enable the IWD service and set it to automatic startup upon startup

systemctl start iwd.service # start service
systemctl enable iwd.service The IWD service is automatically started upon startup
Copy the code

Enable the DNS resolution service provided by Systemd:

systemctl start systemd-resolved.service
systemctl enable systemd-resolved.service
Copy the code

Start the DHCPCD:

systemctl start dhcpcd
systemctl enable dhcpcd
Copy the code

Perform iwctl

dhcpcd
Copy the code

Install display service

pacman -S xorg
Copy the code

Install the graphics card driver

pacman -S xf86-video-intel  # Intel core
pacman -S mesa xf86-video-nouveau  # NVIDIA alone
Copy the code

Installing the Desktop Environment

pacman -S xfce4
Copy the code

Install the display manager

Since the xFCE4 package does not have a display manager (DM), you need to select a DM to install, in this case lightDM:

pacman -S lightdm lightdm-gtk-greeter
Copy the code

Edit the/etc/lightdm lightdm. Conf Settings lightdm – GTK greeter – greeter as the default:

[Seat:*]
...
greeter-session=lightdm-gtk-greeter
...
Copy the code

Set this parameter to automatic startup upon startup

systemctl enable lightdm.service
Copy the code

Adding a Common User

useradd -m -G wheel username
Copy the code

Username is replaced with the username

passwd username
Copy the code

Install sudo

pacman -S sudo
Copy the code

Add username ALL=(ALL) ALL under root ALL=(ALL) ALL in /etc/sudoers

. root ALL=(ALL) ALL username ALL=(ALL) ALL ...Copy the code

Ok, now you can officially experience Arch Linux.

[resources: wiki.archlinux.org/title/Insta…].

[resources: zhuanlan.zhihu.com/p/157260502]