树莓派设置¶
使用清华镜像源¶
先编辑 raspi.list
文件
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
更新系统¶
设置语言¶
选择 en_GB.UTF-8 UTF-8
输入命令 locale
验证
vim¶
安装 vim
基本配置
inoremap <silent> jk <Esc>
vnoremap > >gv
vnoremap < <gv
vnoremap = =gv
set mouse=a
syntax on
filetype plugin indent on
set autoread
set encoding=utf-8
set fileencodings=utf-8
set number
set relativenumber
set cursorline
set tabstop=4
set shiftwidth=4
set expandtab
set backspace=indent,eol,start
set incsearch
set hlsearch
set ignorecase
set smartcase
set laststatus=2
set showcmd
set showmode
set list
set listchars=tab:>-,trail:.
set wildmenu
set wildmode=list:longest,full
set nobackup
set nowritebackup
set noswapfile
docker¶
安装 docker
开机启动
当前用户添加到 docker 用户组
设置 rootless,不推荐
sudo apt update
sudo apt install -y uidmap
dockerd-rootless-setuptool.sh install
echo 'export DOCKER_HOST=unix:///run/user/1000/docker.sock' >> ~/.bashrc
source ~/.bashrc
sudo loginctl enable-linger [username]
# verify
docker info | grep rootless
设置 docker 镜像,可以在这里找找。root 模式是 /etc/docker/daemon.json
,rootless 模式是 ~/.config/docker/daemon.json
sudo vim /etc/docker/daemon.json
# mkdir -p .config/docker
# vim .config/docker/daemon.json
{
"registry-mirrors": [
"https://docker.1ms.run"
]
}
# restart docker, root
sudo systemctl restart docker
# restart docker, rootless
# systemctl --user restart docker.service
测试一下
网络问题¶
下载 mihomo¶
mihomo 这里就直接使用命令行版本,可以从 github 下载,下载的版本是 xxx-linux-arm64-xxx.deb 将文件通过 scp 复制到树莓派
安装文件¶
配置文件¶
编辑 /etc/mihomo/config.yaml
文件,如果不存在就创建 具体内容查看这两个链接
创建完成配置文件可以测试一下
创建服务启动可以参考创建运行服务 - 虚空终端 Docs