Skip to content

Commit 4711c9d

Browse files
committed
update: rewrite post archlinux-setup
1 parent 01c1920 commit 4711c9d

File tree

1 file changed

+22
-39
lines changed

1 file changed

+22
-39
lines changed

content/posts/archlinux-setup/index.md

+22-39
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ slug: archlinux-setup
55
tags: [linux]
66
---
77

8-
Arch的安装确实照着官方教程做一遍就会了,不过每次安装总要看着wiki挺麻烦的,把整个流程记下来方便以後要安装的时候。
9-
10-
****
8+
Archlinux wiki很完善,安装只需要照着文档做一遍就会了。不过每次安装总看wiki挺麻烦的,流程记下来方便以後安装。
119

1210
## 基本
1311

@@ -24,10 +22,14 @@ station <device> connect <SSID>
2422

2523
```shell
2624
fdisk -l <disk>
27-
fdisk <disk> # 进行配置
25+
fdisk <disk> # 进入fdisk命令行
2826
fdisk>> g # 新建GPT分区表
2927
fdisk>> n # 新建分区
30-
fdisk>> t # 更改分区类型 EFI: 1 swap: 19 x86-64-root: 23
28+
29+
fdisk>> t # 更改分区类型
30+
# 1: EFI
31+
# 19: swap
32+
# 23: x86-64-root
3133
fdisk>> w
3234
```
3335

@@ -43,17 +45,19 @@ mkswap <swap_partition>
4345

4446
```shell
4547
mount <root_partition> /mnt
46-
mount <EFI_partition> /mnt/boot # 不存在则加上 --mkdir
48+
mount --mkdir <EFI_partition> /mnt/boot
4749
swapon <swap_partition>
4850
```
4951

5052
### 安装系统
5153

52-
遇上 GPG signature 的问题的话,找到 `/etc/pacman.conf` 中的 `SigLevel` 属性,添加 `TrustAll` 就得,怎么连自家的包都不信任的。
53-
5454
```shell
55-
vim /etc/pacman.d/mirrorlist # Server=https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch
56-
pacstrap -K /mnt base linux linux-firmware amd-ucode intel-ucode networkmgr vim
55+
cat <<'eof' > /etc/pacman.d/mirrorlist
56+
Server = https://mirrors.cernet.edu.cn/archlinux/$repo/os/$arch
57+
eof
58+
59+
# 安装所需软件包,ucode根据实际选择amd-ucode或intel-ucode
60+
pacstrap -K /mnt base linux linux-firmware intel-ucode networkmgr nvim grub efibootmgr
5761
```
5862

5963
### 配置系统
@@ -63,59 +67,38 @@ genfstab -U /mnt >> /mnt/etc/fstab
6367
arch-chroot /mnt
6468
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
6569
hwclock --systohc
66-
vim /etc/locale.gen # en_US.UTF-8
70+
vim /etc/locale.gen # 取消注释"en_US.UTF-8"
6771
locale-gen
6872
echo LANG=en_US.UTF-8 >> /etc/locale.conf
6973
echo <hostname> >> /etc/hostname
70-
passwd
74+
passwd # 记得改密码
7175
```
7276

7377
### bootloader
7478

75-
双系统的话[先看下面](#双系统)
76-
7779
```shell
78-
pacman -S grub efibootmgr
7980
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
8081
grub-mkconfig -o <EFI_partition>/grub/grub.cfg
8182
```
8283

83-
### Nvidia ~~fxxk you~~
84-
85-
```shell
86-
pacman -S nvidia nvidia-utils nvidia-setting
87-
```
84+
## 其他
8885

89-
### 桌面环境
86+
### N卡驱动 ~~fxxk you~~
9087

9188
```shell
92-
pacman -S gnome gnome-tweak
93-
```
94-
95-
## 双系统
96-
97-
> 先安装Windows,后安装Arch,同一个硬盘中的两个系统共用EFI分区。
98-
99-
[挂载分区](#挂载分区)这一步中,`EFI_partition`是Windows安装时划分的:
100-
```shell
101-
mount <EFI_partition> /mnt/boot
89+
pacman -S nvidia nvidia-utils nvidia-setting
10290
```
10391

104-
在配置[bootloader](#bootloader)这一步中:
105-
```shell
106-
pacman -S grub efibootmanager os-prober
107-
vim /etc/default/grub # GRUB_DISABLE_OS_PROBER=false
108-
grub-mkconfig
109-
```
11092

11193
## 参考资料
11294

11395
[Archlinux安装指南](https://wiki.archlinux.org/title/Installation_guide)
11496

115-
[Arch-Win双系统](https://wiki.archlinux.org/title/Dual_boot_with_Windows)
97+
[MirrorZ校园联合镜像站](https://help.mirrors.cernet.edu.cn/archlinux/)
11698

11799
## Changelog
118100

119101
|||
120102
|:-:|:-:|
121-
| 2024-4-17 | #1: 踩到自己挖的坑,修补一下 |
103+
| 2024-10-13 | 又踩到自己挖的坑,修一下 |
104+
| 2024-4-17 | 踩到自己挖的坑,修一下 |

0 commit comments

Comments
 (0)