#!/usr/bin/env bash # # ... # # 使用方法: # URL="https://git.1-h.cc/Scripts/Linux/raw/branch/main/debian/upgrade.sh"; curl -fsSL "$URL" | bash # 设置非交互式环境变量 export DEBIAN_FRONTEND=noninteractive apt -qq update # 安装自动更新 apt install -y unattended-upgrades # 启用自动更新 dpkg-reconfigure -plow unattended-upgrades # 配置自动更新并在凌晨2点自动重启 cat <