温馨提示×

如何配置ubuntu minimal

小樊
34
2026-08-24 05:48:54
栏目: 智能运维

Ubuntu Minimal 通常指最小化安装(只含最基础系统),常见有三种场景:
1️⃣ 安装 Ubuntu Minimal(最小系统)
2️⃣ 在已有 Ubuntu 上精简配置
3️⃣ 使用 Minimal ISO 安装

下面按最常见方式一步步说明。


一、选择安装方式

✅ 方式一:使用 Ubuntu Minimal ISO(推荐)

适用于全新安装,得到一个非常干净的系统。

步骤:

  1. 下载 Minimal ISO

    • 官网地址:
      https://ubuntu.com/download/alternative-downloads
    • 找到 Minimal installation image
  2. 制作启动盘

    # 假设 USB 为 /dev/sdb
    sudo dd if=ubuntu-minimal.iso of=/dev/sdb bs=4M status=progress
    
  3. 安装过程

    • 语言、时区、键盘
    • 分区(建议 ext4 + 一个 / 分区)
    • 安装完成后没有 GUI
    • 只有:
      • 基础 shell
      • apt
      • systemd
      • 网络工具(部分)

二、首次启动后的基础配置

1️⃣ 更新系统

sudo apt update
sudo apt upgrade -y

2️⃣ 配置网络(非常重要)

查看网卡

ip a

使用 netplan(Ubuntu 18.04+)

编辑配置:

sudo nano /etc/netplan/*.yaml

示例(DHCP):

network:
  version: 2
  ethernets:
    eth0:
      dhcp4: true

应用:

sudo netplan apply

3️⃣ 安装常用基础工具

sudo apt install -y \
  vim \
  curl \
  wget \
  git \
  net-tools \
  iputils-ping \
  software-properties-common

4️⃣ 创建普通用户(强烈推荐)

sudo adduser yourname
sudo usermod -aG sudo yourname

三、可选:安装桌面(如果你需要)

GNOME 最小桌面

sudo apt install ubuntu-desktop-minimal

更轻量的桌面

sudo apt install xfce4

启动桌面:

startx

四、在已有 Ubuntu 上“精简”系统

如果你已经装了 Ubuntu,可以手动精简:

删除 GUI(谨慎)

sudo apt purge ubuntu-desktop gnome-shell
sudo apt autoremove --purge

关闭不需要的服务

sudo systemctl disable bluetooth
sudo systemctl disable cups

五、常见用途推荐配置

用途 建议
服务器 不装 GUI
Docker 主机 只装基础系统
开发环境 加 zsh / tmux
嵌入式 使用 minimal + 裁剪内核

六、常见问题

❓ Minimal 和 Server 版区别?

  • Minimal:比 Server 更干净
  • Server:带更多服务器工具(cloud-init 等)

❓ 能装图形界面吗?

✅ 可以,随时 apt install


如果你愿意,可以告诉我:

  • ✅ 是 实体机 / 虚拟机 / 云服务器
  • ✅ 是 桌面还是纯服务器
  • ✅ Ubuntu 版本(20.04 / 22.04 / 24.04)

我可以给你完全定制化的配置方案

0