How to use archlinux: Difference between revisions

From 清冽之泉
Jump to navigation Jump to search
Line 54: Line 54:
== 系统备份 ==
== 系统备份 ==
brtfs 文件系统,支持增量备份,备份在当前盘。
brtfs 文件系统,支持增量备份,备份在当前盘。
<pre>
Snapshots are created using the built-in features of the BTRFS filesystem.
快照使用 BTRFS 文件系统的内置功能来创建。
Snapshots are created and restored instantly.
快照可瞬间创建和还原。
Snapshot creation is an atomic transaction at the file system level.
快照的创建在文件系统层面上是一个原子操作。
Snapshots are restored by replacing system subvolumes. Since files are never copied, deleted or overwritten, there is no risk of data loss. The existing system is preserved as a new snapshot after restore.
快照的还原通过替换系统子卷来完成。由于文件从未被复制、删除或覆盖,因此不存在数据丢失风险。还原后,原有系统会被保存为一个新的快照。
Snapshots are perfect, byte-for-byte copies of the system. Nothing is excluded.
快照是系统的逐字节完整拷贝,不会遗漏任何内容。
Snapshots are saved on the same disk from which they are created (system disk). Storage on other disks is not supported. If system disk fails then snapshots stored on it will be lost along with the system.
快照存储在与其创建源相同的磁盘(即系统盘)上,不支持将快照保存到其他磁盘。如果系统盘出现故障,快照也将随之丢失。
Size of BTRFS snapshots are initially zero. As system files gradually change with time, data gets written to new data blocks which take up disk space (copy-on-write). Files in the snapshot continue to point to original data blocks.
BTRFS 快照的初始大小为零。随着系统文件的变化,新的数据会写入新的数据块(写时复制),占用磁盘空间;而快照中的文件仍然指向原始的数据块。
OS must be installed on a BTRFS partition with Ubuntu-type subvolume layout (@ and @home subvolumes). Other layouts are not supported.
操作系统必须安装在具有 Ubuntu 风格子卷布局(包含 @ 和 @home 子卷)的 BTRFS 分区上,其他布局不受支持。
Devices displayed above have BTRFS filesystems
上方列出的设备均使用 BTRFS 文件系统。
BTRFS snapshots are saved on system partition. Other partitions are not supported.
BTRFS 快照仅保存在系统分区,其他分区不受支持。
Snapshots are saved to /timeshift-btrfs on selected partition. Other locations are not supported.
快照会保存在所选分区的 /timeshift-btrfs 目录下,不支持保存到其他位置。
</pre>


ext4 文件系统,只支持全量备份,可以选择备份位置。
ext4 文件系统,只支持全量备份,可以选择备份位置。

Revision as of 23:04, 10 May 2025

联网安装

若用的不是网线,则需要先联 WIFI 再开始 archinstall。

iwctl
device list
station wlan0 scan
station wlan0 get-networks
station wlan0 connect wifiname
exit
ping bilibili.com
archinstall

换源

# /etc/pacman.d/mirrorlist 配置文件开头加上:
Server = https://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch
# /etc/pacman.conf 配置文件末尾加上:
[archlinuxcn]
Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch

ustc 在开头加,是为了优先用。cn 在末尾加,是因为这是社区而非官方维护的镜像,放末尾避免干扰其他默认配置。

简单使用

# 更新系统 Sync refresh upgrade
sudo pacman -Syu

# 查找 Sync search
pacman -Ss

# 查看 Query
pacman -Qs

# 安装
sudo pacman -S

# 卸载软件 Remove
sudo pacman -R

# 卸载无用依赖
sudo pacman -Rns

# 清除孤立不用的包
sudo pacman -Qqdt | sudo pacman -Rs -

# pacman 支持通配符 ^开头 $结尾

系统备份

brtfs 文件系统,支持增量备份,备份在当前盘。

Snapshots are created using the built-in features of the BTRFS filesystem.
快照使用 BTRFS 文件系统的内置功能来创建。

Snapshots are created and restored instantly.
快照可瞬间创建和还原。

Snapshot creation is an atomic transaction at the file system level.
快照的创建在文件系统层面上是一个原子操作。

Snapshots are restored by replacing system subvolumes. Since files are never copied, deleted or overwritten, there is no risk of data loss. The existing system is preserved as a new snapshot after restore.
快照的还原通过替换系统子卷来完成。由于文件从未被复制、删除或覆盖,因此不存在数据丢失风险。还原后,原有系统会被保存为一个新的快照。

Snapshots are perfect, byte-for-byte copies of the system. Nothing is excluded.
快照是系统的逐字节完整拷贝,不会遗漏任何内容。

Snapshots are saved on the same disk from which they are created (system disk). Storage on other disks is not supported. If system disk fails then snapshots stored on it will be lost along with the system.
快照存储在与其创建源相同的磁盘(即系统盘)上,不支持将快照保存到其他磁盘。如果系统盘出现故障,快照也将随之丢失。

Size of BTRFS snapshots are initially zero. As system files gradually change with time, data gets written to new data blocks which take up disk space (copy-on-write). Files in the snapshot continue to point to original data blocks.
BTRFS 快照的初始大小为零。随着系统文件的变化,新的数据会写入新的数据块(写时复制),占用磁盘空间;而快照中的文件仍然指向原始的数据块。

OS must be installed on a BTRFS partition with Ubuntu-type subvolume layout (@ and @home subvolumes). Other layouts are not supported.
操作系统必须安装在具有 Ubuntu 风格子卷布局(包含 @ 和 @home 子卷)的 BTRFS 分区上,其他布局不受支持。

Devices displayed above have BTRFS filesystems
上方列出的设备均使用 BTRFS 文件系统。

BTRFS snapshots are saved on system partition. Other partitions are not supported.
BTRFS 快照仅保存在系统分区,其他分区不受支持。

Snapshots are saved to /timeshift-btrfs on selected partition. Other locations are not supported.
快照会保存在所选分区的 /timeshift-btrfs 目录下,不支持保存到其他位置。

ext4 文件系统,只支持全量备份,可以选择备份位置。

.bashrc 强化

export EDITOR=emacs
alias s='ls -hl'
alias pn='sudo pacman -Syu'
alias pi='sudo pacman -S'
alias pr='sudo pacman -Rns'
alias pss='pacman -Ss'
alias eb='emacs ~/.bashrc'
alias sb='source ~/.bashrc'
alias sp='poweroff'
alias sr='reboot'

令中文不显示成方框

sudo pacman -S wqy-microhei noto-fonts-cjk adobe-source-han-sans-cn-fonts adobe-source-han-serif-cn-fonts adobe-source-han-sans-tw-fonts adobe-source-han-serif-tw-fonts
sudo nano /etc/locale.gen
去掉 zh_CN.UTF-8 UTF-8 前的 # 号
sudo locale-gen

安装中文输入法

sudo pacman -S ibus-rime
ibus-setup

xfce4 调试

# 这是针对 xfce4 下 ibus-rime 的调试
# 设置 ibus-rime 依赖的环境变量
# 把以下放入 .xprofile
export GTK_IM_MODULE=ibus
export XMODIFIERS=@im=ibus
export QT_IM_MODULE=ibus
ibus-daemon -drx

kde 调试

在系统设置 Input 里调 ibus-rime。

# 关掉开机等待
sudo nano /etc/default/grub
sudo grub-mkconfig -o /boot/grub/grub.cfg