From e3f8c209ee1d2b81ab04a989bff4ef70f5193f9d Mon Sep 17 00:00:00 2001
From: taynpg <taynpg@163.com>
Date: Thu, 2 Jan 2025 13:33:45 +0800
Subject: [PATCH] =?UTF-8?q?arch=E5=AE=89=E8=A3=85=E7=AE=80=E8=A6=81?=
 =?UTF-8?q?=E8=AE=B0=E5=BD=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 os/arch_install.txt | 128 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 128 insertions(+)
 create mode 100644 os/arch_install.txt

diff --git a/os/arch_install.txt b/os/arch_install.txt
new file mode 100644
index 0000000..00c6919
--- /dev/null
+++ b/os/arch_install.txt
@@ -0,0 +1,128 @@
+《Arch安装过程(全新安装)(需要网络)》GPT+UEFI
+来源于:https://github.com/nakanomikuorg/arch-guide
+
+名词解释:
+AUR:Arch User Repository,用户自行打包软件,不在Arch官方支持内。
+ARCHCN:中文社区仓库,同上。
+EULA:专有软件。
+
+#####################################################################################################
+1.基本准备
+①关闭reflector服务(自动更新软件源功能,由于国内网络原因导致并不好用):systemctl stop reflector.service
+②(可选)禁用蜂鸣:加入blacklist pcspkr到/etc/modprobe.d/blacklist.conf
+③(可选)查看UEFI:ls /sys/firmware/efi/efivars
+④(可选)无线连接:
+iwctl
+device list
+station wlan0 scan
+station wlan0 get-networks
+station wlan0 connect wifi-name
+exit
+⑤系统时钟:timedatectl set-ntp true
+⑥国内源:vim /etc/pacman.d/mirrorlist
+Server = https://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch # 中国科学技术大学开源镜像站
+Server = https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch # 清华大学开源软件镜像站
+Server = https://repo.huaweicloud.com/archlinux/$repo/os/$arch # 华为开源镜像站
+Server = http://mirror.lzu.edu.cn/archlinux/$repo/os/$arch # 兰州大学开源镜像站
+
+#####################################################################################################
+2.分区与格式化(Btrfs文件系统)
+①查看分区情况:fdisk -l
+②分区(GPT)(上下键选分区,左右选功能):cfdisk
+-- (可选)全新安装多分一个EFI分区(建议512M)(默认是LinuxFilesystem类型,注意更改为EFI System)。
+-- SWAP分区(建议内存的60%,也可一样)(默认是LinuxFilesystem类型,注意更改为Linux Swap)。
+-- 由于Btrfs系统,根目录与用户目录一个分区,故剩余空间全部为LinuxFilesystem分区即可。
+-- write保存。
+③lsblk查看分区情况。
+④格式化EFI分区:mkfs.fat -F32 /dev/sdxn
+⑤格式化SWAP分区:mkswap /dev/sdxn
+⑥格式化BTRFS分区:mkfs.btrfs -L tarch /dev/sdxn
+⑦创建子卷:
+-- mount -t btrfs -o compress=zstd /dev/sdxn /mnt
+-- btrfs subvolume create /mnt/@
+-- btrfs subvolume create /mnt/@home
+-- (查看)btrfs subvolume list -p /mnt
+-- umount /mnt
+
+#####################################################################################################
+3.挂载
+mount -t btrfs -o subvol=/@,compress=zstd /dev/sdxn /mnt
+mkdir /mnt/home
+mount -t btrfs -o subvol=/@home,compress=zstd /dev/sdxn /mnt/home
+mkdir -p /mnt/boot
+mount /dev/sdxn /mnt/boot
+swapon /dev/sdxn
+
+#####################################################################################################
+3.安装(如果使用btrfs文件系统,额外安装一个btrfs-progs包)
+①pacstrap /mnt base base-devel linux linux-firmware btrfs-progs
+-- (若GPG证书错误,尝试pacman -S archlinux-keyring)
+②pacstrap /mnt networkmanager vim sudo zsh zsh-completions
+-- ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
+③生成磁盘分区信息:genfstab -U /mnt > /mnt/etc/fstab
+④变更到安装到的磁盘中的系统:arch-chroot /mnt
+⑤设置主机名(如tarch):vim /etc/hostname
+-- hwclock --systohc
+⑥设置匹配:vim /etc/hosts
+127.0.0.1   localhost
+::1         localhost
+127.0.1.1   tarch.localdomain tarch
+⑦设置Locale:vim /etc/locale.gen
+-- 放开:en_US.UTF-8 UTF-8和zh_CN.UTF-8 UTF-8
+-- locale-gen
+-- 向/etc/locale.conf中写入:LANG=en_US.UTF-8
+⑧设置密码:passwd root
+⑨安装微码:
+pacman -S intel-ucode # Intel
+pacman -S amd-ucode # AMD
+⑩安装引导程序:pacman -S grub efibootmgr os-prober
+-- grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=ARCH
+-- vim /etc/default/grub,去除quiet,loglevel改为5,可以加入nowatchdog
+-- 如果双系统:GRUB_DISABLE_OS_PROBER=false
+-- grub-mkconfig -o /boot/grub/grub.cfg
+最后:exit,umout -R /mnt,  reboot
+
+#####################################################################################################
+3.配置(pacman -S fastfetch)
+①设置网络:
+systemctl enable --now NetworkManager
+ping www.bilibili.com
+②如果是无线:
+nmcli dev wifi list
+nmcli dev wifi connect "Wi-Fi名(SSID)" password "网络密码"
+③添加用户
+useradd -m -G wheel -s /bin/bash myusername
+passwd myusername
+EDITOR=vim visudo
+放开:#%wheel ALL=(ALL:ALL) ALL
+④开启32支持:
+vim /etc/pacman.conf
+放开:[multilib]和相邻行并添加(选其一即可):
+[archlinuxcn]
+Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch # 中国科学技术大学开源镜像站
+Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch # 清华大学开源软件镜像站
+Server = https://mirrors.hit.edu.cn/archlinuxcn/$arch # 哈尔滨工业大学开源镜像站
+Server = https://repo.huaweicloud.com/archlinuxcn/$arch # 华为开源镜像站
+⑤KDE桌面:
+-- pacman -Syyu
+-- pacman -S plasma-meta konsole dolphin # plasma-meta
+-- pacman -S  plasma-workspace xdg-desktop-portal
+⑥配置sddm自启动:
+systemctl enable sddm && reboot
+⑦基础包:
+sudo pacman -S sof-firmware alsa-firmware alsa-ucm-conf # 声音固件
+sudo pacman -S ntfs-3g # 使系统可以识别 NTFS 格式的硬盘
+sudo pacman -S adobe-source-han-serif-cn-fonts wqy-zenhei # 安装几个开源中文字体。一般装上文泉驿就能解决大多 wine 应用中文方块的问题
+sudo pacman -S noto-fonts noto-fonts-cjk noto-fonts-emoji noto-fonts-extra # 安装谷歌开源字体及表情
+sudo pacman -S firefox chromium # 安装常用的火狐、chromium 浏览器
+sudo pacman -S ark # 压缩软件。在 dolphin 中可用右键解压压缩包
+sudo pacman -S packagekit-qt6 packagekit appstream-qt appstream # 确保 Discover(软件中心)可用,需重启
+sudo pacman -S gwenview # 图片查看器
+sudo pacman -S steam # 游戏商店。稍后看完显卡驱动章节再使用
+⑧签名
+sudo pacman -S archlinuxcn-keyring
+sudo pacman -S yay
+⑨家目录常见目录如果没有:
+cd ~
+ls -hl
+xdg-user-dirs-update