树莓派3b 安装arch linux 2

配置swap

swapon /dev/mmcblk0p3
nano /etc/fstab
/dev/mmcblk0p3  swap    swap    defaults        0       0

更换国内更新源

nano /etc/pacman.d/mirrorlist

在顶部添加

Server = https://mirrors.ustc.edu.cn/archlinuxarm/$arch/$repo
Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch

初始化pacman

pacman-key --init
pacman-key --populate archlinuxarm

更新系统

pacman -Syu

配置ssh 使用公钥登录

port XXXX #更换一个端口
PubkeyAuthentication yes
PermitRootLogin no
StrictModes yes
PasswordAuthentication no
PermitEmptyPasswords no

生成ssh key

cd ~
mkdir .ssh
touch authorized_keys
ssh-keygen -t ed25519 -f root

把root.pub的内容复制到 authorized_keys 中

chmod 400 authorized_keys
chmod 700 ~/.ssh

禁止root用户登录

chsh root -s /sbin/nologin

安装yaourt

pacman -S yajl
pacman -U package-query-1.9-3-aarch64.pkg.tar.xz
pacman -Syu yaourt

其中package-query编译有点麻烦 首先要安装 base-devel

下载 https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=package-query

然后运行 makepkg

EOF

原文地址:https://www.cnblogs.com/BD1A489/p/10384618.html