@@ -5,9 +5,7 @@ slug: archlinux-setup
5
5
tags : [linux]
6
6
---
7
7
8
- Arch的安装确实照着官方教程做一遍就会了,不过每次安装总要看着wiki挺麻烦的,把整个流程记下来方便以後要安装的时候。
9
-
10
- ****
8
+ Archlinux wiki很完善,安装只需要照着文档做一遍就会了。不过每次安装总看wiki挺麻烦的,流程记下来方便以後安装。
11
9
12
10
## 基本
13
11
@@ -24,10 +22,14 @@ station <device> connect <SSID>
24
22
25
23
``` shell
26
24
fdisk -l < disk>
27
- fdisk < disk> # 进行配置
25
+ fdisk < disk> # 进入fdisk命令行
28
26
fdisk>> g # 新建GPT分区表
29
27
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
31
33
fdisk>> w
32
34
```
33
35
@@ -43,17 +45,19 @@ mkswap <swap_partition>
43
45
44
46
``` shell
45
47
mount < root_partition> /mnt
46
- mount < EFI_partition> /mnt/boot # 不存在则加上 --mkdir
48
+ mount --mkdir < EFI_partition> /mnt/boot
47
49
swapon < swap_partition>
48
50
```
49
51
50
52
### 安装系统
51
53
52
- 遇上 GPG signature 的问题的话,找到 ` /etc/pacman.conf ` 中的 ` SigLevel ` 属性,添加 ` TrustAll ` 就得,怎么连自家的包都不信任的。
53
-
54
54
``` 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
57
61
```
58
62
59
63
### 配置系统
@@ -63,59 +67,38 @@ genfstab -U /mnt >> /mnt/etc/fstab
63
67
arch-chroot /mnt
64
68
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
65
69
hwclock --systohc
66
- vim /etc/locale.gen # en_US.UTF-8
70
+ vim /etc/locale.gen # 取消注释" en_US.UTF-8"
67
71
locale-gen
68
72
echo LANG=en_US.UTF-8 >> /etc/locale.conf
69
73
echo < hostname> >> /etc/hostname
70
- passwd
74
+ passwd # 记得改密码
71
75
```
72
76
73
77
### bootloader
74
78
75
- 双系统的话[ 先看下面] ( #双系统 ) 。
76
-
77
79
``` shell
78
- pacman -S grub efibootmgr
79
80
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
80
81
grub-mkconfig -o < EFI_partition> /grub/grub.cfg
81
82
```
82
83
83
- ### Nvidia ~~ fxxk you~~
84
-
85
- ``` shell
86
- pacman -S nvidia nvidia-utils nvidia-setting
87
- ```
84
+ ## 其他
88
85
89
- ### 桌面环境
86
+ ### N卡驱动 ~~ fxxk you ~~
90
87
91
88
``` 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
102
90
```
103
91
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
- ```
110
92
111
93
## 参考资料
112
94
113
95
[ Archlinux安装指南] ( https://wiki.archlinux.org/title/Installation_guide )
114
96
115
- [ Arch-Win双系统 ] ( https://wiki.archlinux.org/title/Dual_boot_with_Windows )
97
+ [ MirrorZ校园联合镜像站 ] ( https://help.mirrors.cernet.edu.cn/archlinux/ )
116
98
117
99
## Changelog
118
100
119
101
|||
120
102
| :-:| :-:|
121
- | 2024-4-17 | #1 : 踩到自己挖的坑,修补一下 |
103
+ | 2024-10-13 | 又踩到自己挖的坑,修一下 |
104
+ | 2024-4-17 | 踩到自己挖的坑,修一下 |
0 commit comments