本文主要介绍在树莓派上配置Archlinux系统,因为Archlinux是精简安装,所以安装完后要做一些基本的配置和优化。可根据自己的需要进行配置,这里是我的配置记录,可供参考。
一.基本配置
配置网络
- 有线网络
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
| # 有线网络
~$ sudo vim /etc/systemd/network/20-wired.network
[Match]
Name=eth0 # w
Type=ether
[Network]
DHCP=yes
## 静态IP
[Network]
Address=10.1.10.9/24
Gateway=10.1.10.1
DNS=10.1.10.1
#DNS=8.8.8.8
# 启动网络服务
~$ sudo systemctl enable --now systemd-networkd.service
|
- 无线网络wlan
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
| # 安装包
$ pacman -S wireless_tools dialog libnl wpa_supplicant
# SSID PASSWD
~$ wpa_passphrase HUAWEI 12345678
network={
ssid="HUAWEI"
#psk="12345678"
psk=3a0da8cfedc18f6d7d8c61427378d2a9b1348b3541055535cc
}
~$ sudo vim /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
update_config=1
fast_reauth=1
ap_scan=1
network={
ssid="HUAWEI"
#psk="12345678"
psk=3a0da8cfedc18f6d7d8c61427378d2a9b1348b3541055535cc
}
~$ sudo systemctl enable --now wpa_supplicant@wlan0.service
~$ sudo vim /etc/systemd/network/25-wireless.network
[Match]
Name=wlan0 # 网卡名
Type=wlan
[Network]
DHCP=yes
~$ sudo systemctl enable --now systemd-networkd.service
|
1.更新系统
2.更新时区
1
| timedatectl set-timezone Asia/ShangHai
|
3.把用户加入用户组
nano /etc/sudoers
添加
1
2
| # 执行sudo 时不需要输入密码
%wheel ALL=(ALL) NOPASSWD: ALL
|
4.安装中文字体
1
2
| # 安装思源黑体字体
~$ sudo pacman -S adobe-source-han-sans-cn-fonts
|
5.基本开发环境
1
2
3
| ~$ sudo pacman -Sy git vim
~$ sudo pacman -Sy tldr
~$ sudo pacman -Sy bat tree
|
6.安装Python3
1
| sudo pacman -S python python-pip ipython
|
7.系统监测
1
| sudo pacman -S htop neofetch
|
二.安装桌面环境
1.安装基本组建
1
| sudo pacman -S base-devel
|
2.安装桌面服务
1
| sudo pacman -S xorg-xinit xorg-server xorg-utils xorg-server-utils
|
3.安装音视频相关驱动
1
| sudo pacman -S xf86-video-fbdev xf86-video-vesa
|
4.安装mate桌面环境
1
| sudo pacman -S mate mate-extra
|
5.安装管理器,启动器
1
| pacman -S openbox lxde gamin dbus mesa
|
6.修改配置文件
添加如下内容
1
2
| $ sudo vim ~/.xinitrc
exec mate-session
|
7.关机重启
开机启动后登陆输入startx便可以进入mate桌面环境。到此桌面环境配置完成了。
三.进阶配置
1.安装fcitx5输入法
1
| sudo pacman -S fcitx5-im fcitx5-chinese-addons
|
编辑~/.xinitrc
1
2
3
4
5
6
7
8
| $ vim ~/.xinitrc
export LANG=zh_CN.UTF-8
export XIM=fcitx
export XMODIFIERS="@im=fcitx"
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XIM_PROGRAM=fcitx
fcitx &
|
保存退出!
2.安装火狐浏览器
1
| $ sudo pacman -S firefox firefox-i18n-zh-cn
|
3.设置中文环境
1
2
3
4
5
6
| $ sudo vim /etc/locale.conf
LANG=zh_CN.UTF-8
# or
~$ localectl set-locale LANG=en_US.UTF-8
~$ localectl status
|
4.音频设置
1
| $ pacman -Sy alsa-utils alsa-firmware alsa-lib alsa-plugins
|
选择一个音频输出
amixer cset numid=3 x
参数设置为:
5.安装zsh
1
2
3
4
5
6
7
8
| ~$ sudo pacman -Sy zsh
~$ sudo pacman -Sy community/zsh-completions
~$ sudo pacman -Sy community/zsh-autosuggestions
~$ sudo pacman -Sy community/zsh-syntax-highlighting
~$ sudo pacman -Sy community/zsh-theme-powerlevel10k
# 设置alarm的默认shell为zsh
$ chsh -s /bin/zsh alarm
|
6. 使用yay管理 AUR
- yay简介
Jguer/yay: Yet another Yogurt - An AUR Helper written in Go (github.com)
yay使用go语言写的yogurt的替代品,用来管理AUR包,使用时不需要加sudo
1
2
3
4
5
| # install yay
pacman -S --needed git base-devel
git clone https://aur.archlinux.org/yay-bin.git
cd yay-bin
makepkg -si
|
- 基本使用
1
2
3
4
5
6
7
8
9
10
| $ yay -Sy [pkg]
# 打印系统包信息
$ yay -Ps
# 清除未使用的依赖
$ yay -Yc
# install Google Noto font
~$ yay -Sy noto-fonts-sc
# install OSX fonts
~$ yay -Sy ttf-mac-fonts
|
7. 安装中文man_page
1
| ~$ sudo pacman -Sy community/man-pages-zh_cn
|