Caution
阶段 12(NVIDIA)风险较高:驱动与内核/显卡不匹配可能导致黑屏;Secure Boot、linux-headers 需自行确认。本脚本在 4060 Ti 上验证过,但不保证 100% 无问题,请先核对 ubuntu-drivers devices。
Note
新机器 apt 锁
首次开机常有 unattended-upgrades 占锁。脚本会临时停止相关服务并等待(APT_LOCK_MAX_WAIT)。仍卡住:sudo systemctl stop unattended-upgrades。
Tip
加上 -y 跳过确认,例如 ./setup.sh --stages 01,02,04,05 -y
Important
不要用 root 跑 setup.sh(需要普通用户 + sudo 权限)。
cp -n config/config.env.example config/config.env
# 编辑 config/config.env
cd install
./setup.sh --help
./setup.sh --stages 01,02,04,05未传 --stages 时交互选择。命令说明以 ./setup.sh --help 为准。
| 阶段 | 内容 |
|---|---|
| 01 | APT 镜像(APT_MIRROR=aliyun|tuna|official) |
| 02 | 基础包 install/packages/base.txt |
| 03 | 系统包 install/packages/system.txt(桌面软件,服务器可跳过) |
| 04 | Docker CE |
| 05 | 本地 Docker 镜像导入(installers/docker/) |
| 06 | OpenJDK + Apache Maven |
| 07 | nvm / Node / nrm / pnpm |
| 08 | Git 全局身份 |
| 09 | 写入 environment.env |
| 10 | installers/ 本地 deb / AppImage / tar |
| 11 | fcitx5 + 可选词库 |
| 12 | NVIDIA(ubuntu-drivers,危险) |
Tip
空目录会跳过,不失败。
installers/
├── deb/ # *.deb
├── appimage/ # *.AppImage
├── tar/ # *.tar.gz(如 JetBrains Toolbox)
└── docker/ # *.tar.gz
| 脚本 | 说明 |
|---|---|
migrate-from-sdkman.sh |
离开 SDKMAN:APT Java + /opt/maven,见 --help |
clean-proxy.sh |
清理用户代理设置,见 --help |
mysql-db-backup/ |
MySQL 8.x 备份 / 快照 / 恢复,见各脚本 --help |
本项目采用 Apache License 2.0。