Ubuntu Minimal 是一个轻量级的 Ubuntu 发行版,它只包含最基本的系统工具和应用程序,非常适合需要最小化系统资源占用的用户,如服务器、物联网设备或开发者。以下是关于 Ubuntu Minimal 定制化的教程:
#!/bin/bash
# 设置时区
echo "Setting timezone..."
timedatectl set-timezone Asia/Shanghai
# 更新软件包列表
echo "Updating package list..."
apt-get update
# 安装基本软件包
echo "Installing basic packages..."
apt-get install -y \
ubuntu-minimal \
ca-certificates \
netbase \
openssh-server \
vim \
wget \
curl \
htop
# 配置 SSH 服务
echo "Configuring SSH service..."
systemctl enable ssh
systemctl start ssh
# 创建新用户(可选)
echo "Creating a new user (optional)..."
read -p "Enter username: " username
useradd -m -s /bin/bash $username
passwd $username
# 提示完成
echo "Minimal Ubuntu setup complete!"
请注意,Ubuntu 版本更新较快,具体步骤和界面可能会随版本不同而有所变化。建议在安装前查阅最新的官方安装指南。