跳转至

从零开始安装 Arch Linux

文档时效性说明

本文为早期笔记,可能存在版本过时、命令失效、链接失效、最佳实践变化等问题。请以官方最新文档为准。

原英文标题:Install Arch Linux from Scratch

1. 下载 ISO

下载 Arch Linux ISO 镜像

通过 Rufus 烧录到 U 盘

访问 阿里云镜像站 以加快下载速度

2. 启动 Live 环境

如果遇到类似 "nouveau: unknown chipset" 的错误,按 e 键编辑 grub 启动项,添加

nomodeset

连接 Wi-Fi

1
2
3
4
iwctl
station wlan0 scan
station wlan0 get-networks
station wlan0 connect SSID

更新系统时间

timedatectl set-ntp true

磁盘分区

fdisk /dev/sdX

挂载文件系统

mount /dev/partition /mnt

3. 安装基础系统

使用镜像列表

vim /etc/pacman.d/mirrorlist

安装基础系统

pacstrap /mnt base linux linux-firmware

生成 fstab

genfstab -U /mnt >> /mnt/etc/fstab

切换 root 环境

arch-chroot /mnt

生成 ramfs

mkinitcpio -P

设置 root 密码

passwd

安装必要的软件包

pacman -S iw vim

4. 安装 Grub

1
2
3
4
mkdir /boot/efi
pacman -S grub efibootmgr
grub-install --target=x86_64-efi --efi-directory=/boot/ --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg

5. 安装 KDE Plasma

1
2
3
pacman -S plasma
pacman -S kde-applications
systemctl enable sddm

6. 原文(English)

---
tags:
  - Arch Linux
  - Linux
---

# Install Arch Linux from Scratch


!!! warning "文档时效性说明"
    本文为早期笔记,可能存在版本过时、命令失效、链接失效、最佳实践变化等问题。请以官方最新文档为准。

## Download iso

Download [Arch Linux iso image](https://archlinux.org/download/) 

burn it via [Rufus](https://rufus.ie/)

Visit [Aliyun mirrors](https://developer.aliyun.com/mirror/) for faster download

## Boot Live Environment

if you encountered error like "nouveau: unknown chipset", hit `e` to edit grub, add
nomodeset
1
2
3
4
5
6
7
Connect to wifi

```bash
iwctl
station wlan0 scan
station wlan0 get-networks
station wlan0 connect SSID

Update time

timedatectl set-ntp true

Partition disk

fdisk /dev/sdX

Mount filesystems

mount /dev/partition /mnt

Install Base System

Use mirrorlist

vim /etc/pacman.d/mirrorlist

Install base system

pacstrap /mnt base linux linux-firmware

Generate fstab

genfstab -U /mnt >> /mnt/etc/fstab

Change root

arch-chroot /mnt

Generate ramfs

mkinitcpio -P

Set root password

passwd

install packages that are necessary

pacman -S iw vim

Install Grub

1
2
3
4
mkdir /boot/efi
pacman -S grub efibootmgr
grub-install --target=x86_64-efi --efi-directory=/boot/ --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg

Install KDE Plasma

1
2
3
pacman -S plasma
pacman -S kde-applications
systemctl enable sddm
```