Skip to content

系统设置 ​

更新软件包列表 ​

bash
apt update

Swap ​

一键创建并启用 Swap,4G 可按需修改:

bash
curl -fsSL https://raw.githubusercontent.com/Cretezy/Swap/master/swap.sh | sh -s -- 4G

国内加速版:

bash
curl -fsSL https://gh-proxy.com/https://raw.githubusercontent.com/Cretezy/Swap/master/swap.sh | sh -s -- 4G

脚本默认使用 /swapfile,并写入 /etc/fstab 以开机启用;仅用于首次创建,已有该文件或对应配置时不要重复执行。

设置主机名 ​

bash
# 查看主机名
hostnamectl

# 设置主机名
hostnamectl set-hostname HOSTNAME

修改主机名后,同步检查 /etc/hosts 中的本机映射。

基于 MIT 许可发布