温馨提示×

VirtualBox Debian如何卸载

小樊
35
2026-08-25 15:50:50
栏目: 智能运维

VirtualBox 里运行的 Debian 中卸载软件或系统,常见有几种情况。下面按 最常见需求 给你说明。


一、在 Debian 中卸载软件(最常见)

1️⃣ 使用 apt 卸载软件(推荐)

卸载软件但保留配置文件

sudo apt remove 软件名

卸载软件并删除配置文件

sudo apt purge 软件名

清理无用的依赖

sudo apt autoremove

✅ 示例:卸载 vim

sudo apt purge vim
sudo apt autoremove

2️⃣ 使用 dpkg 卸载(不推荐,除非 apt 不行)

sudo dpkg -r 软件名

查看已安装软件:

dpkg -l

二、卸载 VirtualBox 增强功能(Guest Additions)

如果你装过 VirtualBox 增强功能

sudo /opt/VBoxGuestAdditions-*/uninstall.sh

然后重启:

sudo reboot

三、彻底删除 Debian 虚拟机(从 VirtualBox 中)

方法 1:通过 VirtualBox 图形界面

  1. 关闭 Debian 虚拟机
  2. 右键虚拟机 → 删除
  3. 选择 删除所有文件

✅ 这是最干净的方式


方法 2:手动删除(命令行)

VBoxManage unregistervm "Debian" --delete

或手动删除:

rm -rf ~/VirtualBox\ VMs/Debian

四、卸载 VirtualBox 本身(宿主机)

Ubuntu / Debian 宿主机

sudo apt purge virtualbox*
sudo apt autoremove

Windows 宿主机

  • 控制面板 → 程序和功能 → 卸载 Oracle VM VirtualBox

五、我需要你确认一下 ✅

你可以直接告诉我:

  • ✅ 是 卸载 Debian 里的某个软件
  • ✅ 还是 删除整个 Debian 虚拟机
  • ✅ 还是 卸载 VirtualBox 软件本身

我可以给你 精确到每一步的命令

0