uefi安装ArchLinux

准备

使用iwctl连网略
换源

1
2
reflector -c China --save /etc/pacman.d/mirrorlist
systemctl stop reflector

调整时间

1
timedatectl set-ntp true

分区

lsblk看分区名 cfdisk分区 格式化分区用mkfs.ext4 挂载swap分区用mkswap 用mount挂载根分区到/mnt 新建efi挂载点文件夹

1
mkdir -p /mnt/boot/efi

然后挂载

安装基本系统

1
pacstrap /mnt linux-zen linux-firmware linux-zen-headers base base-devel neovim base-completion networkmanager dhcpcd

写进分区表

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

进系统&安装引导

用arch-chroot进系统然后安装grub引导

1
2
3
arch-chroot /mnt
pacman -Sy
pacman -S grub efibootmgr efivar intel-ucode os-prober ntfs-3g

/etc/default/grub取消注释os-prober的一行(一般在最后一行)

1
2
3
4
5
6
grub-install /dev/……
grub-mkconfig -o /boot/grub/grub.cfg
passwd root
systemctl enable NetworkManager
exit
reboot

进入系统

nmtui联网 nvim /etc/hostname写下arch 在nvim /etc/hosts写下

1
2
3
127.0.0.1	localhost
::1		localhost
127.0.1.1	arch.localdomain	arch

设置时间

1
2
timedatectl set-timezone Asia/Shanghai && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && hwclock --systohc
timedatectl set-ntp true

/etc/skel/.bashrc写下

1
EDITOR='nvim'

然后cp -a /etc/skel/. ~ 重启

添加用户

1
2
3
useradd --create-home storm
passwd storm
usermod -aG adm,wheel,storage storm

EDITOR='nvim' visudo 删除%wheel ALL=(ALL:ALL) ALL前面的# 然后重启

本地化配置

1
nvim /etc/locale.gen

编辑/etc/locale.gen文件,删除en_US.UTF-8 UTF-8和zh_CN.UTF-8 UTF-8前面的# locale-gen nvim /etc/locale.conf 写下LANG=“en_US.UTF-8” 重启

安装plasma

安装核显驱动

1
pacman -S mesa xf86-video-intel vulkan-intel

安装声音驱动

1
2
pacman -S alsa-utils alsa-plugins alsa-oss alsa-firmware sof-firmware alsa-ucm-conf pulseaudio pulseaudio-alsa pulseaudio-bluetooth
systemctl enable bluetooth

安装plasma

1
2
3
pacman -S plasma plasma-meta konsole dolphin kate ark gwenview vlc firefox
firefox-i18n-zh-cn packagekit-qt5
systemctl enable sddm

重启后就可以了

添加其他源

导入arch4edu的GPG Key

1
sudo pacman-key --recv-keys 7931B6D628C8D3BA && sudo pacman-key --finger 7931B6D628C8D3BA && sudo pacman-key --lsign-key 7931B6D628C8D3

编辑/etc/pacman.conf,添加如下

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
[archlinuxcn]
Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch

[arch4edu]
SigLevel = Never
Server = https://mirrors.tuna.tsinghua.edu.cn/arch4edu/$arch

[blackarch]
SigLevel = Never
Server = https://mirrors.ustc.edu.cn/blackarch/$repo/os/$arch

之后更新源pacman -Syy
安装keyring

1
sudo pacman -S archlinuxcn-keyring arch4edu-keyring blackarch-keyring

生成新的密钥环并重新部署

1
sudo rm -rf /etc/pacman.d/gnupg && sudo pacman-key --init && sudo pacman-key --populate archlinux && sudo pacman-key --populate archlinuxcn && sudo pacman-key --populate arch4edu && sudo pacman-key --populate blackarch

然后删除SigLevel = Never

萌ICP备20241614号