我从 Ubuntu 16.04LTS(服务器,仅限 CL)进行了 dist 升级到 18.04LTS,然后是 20.04LTS。
在此操作过程中,似乎已经安装了某种 gnome gui。
根据这篇文章验证:https://ostechnix.com/how-to-check-if-gui-is-installed-in-linux-from-commandline/
$ ls /usr/bin/*session
/usr/bin/byobu-select-session /usr/bin/gnome-session
/usr/bin/dbus-run-session /usr/bin/gnome-session-custom-session
$ type Xorg
Xorg is /usr/bin/Xorg
$ ls /usr/share/xsessions/
ubuntu.desktop
$ dpkg -l | grep xserver
ii x11-xserver-utils 7.7+8 amd64 X server utilities
ii xserver-common 2:1.20.13-1ubuntu1~20.04.2 all common files used by various X servers
ii xserver-xephyr 2:1.20.13-1ubuntu1~20.04.2 amd64 nested X server
ii xserver-xorg 1:7.7+19ubuntu14 amd64 X.Org X server
ii xserver-xorg-core 2:1.20.13-1ubuntu1~20.04.2 amd64 Xorg X server - core server
ii xserver-xorg-input-all 1:7.7+19ubuntu14 amd64 X.Org X server -- input driver metapackage
ii xserver-xorg-input-libinput 0.29.0-1 amd64 X.Org X server -- libinput input driver
ii xserver-xorg-input-wacom 1:0.39.0-0ubuntu1 amd64 X.Org X server -- Wacom input driver
ii xserver-xorg-legacy 2:1.20.13-1ubuntu1~20.04.2 amd64 setuid root Xorg server wrapper
ii xserver-xorg-video-all 1:7.7+19ubuntu14 amd64 X.Org X server -- output driver metapackage
ii xserver-xorg-video-amdgpu 19.1.0-1 amd64 X.Org X server -- AMDGPU display driver
ii xserver-xorg-video-ati 1:19.1.0-1 amd64 X.Org X server -- AMD/ATI display driver wrapper
ii xserver-xorg-video-fbdev 1:0.5.0-1ubuntu1 amd64 X.Org X server -- fbdev display driver
ii xserver-xorg-video-intel 2:2.99.917+git20200226-1 amd64 X.Org X server -- Intel i8xx, i9xx display driver
ii xserver-xorg-video-nouveau 1:1.0.16-1 amd64 X.Org X server -- Nouveau display driver
ii xserver-xorg-video-qxl 0.1.5+git20200331-1 amd64 X.Org X server -- QXL display driver
ii xserver-xorg-video-radeon 1:19.1.0-1 amd64 X.Org X server -- AMD/ATI Radeon display driver
ii xserver-xorg-video-vesa 1:2.4.0-2 amd64 X.Org X server -- VESA display driver
ii xserver-xorg-video-vmware 1:13.3.0-3 amd64 X.Org X server -- VMware display driver
如何删除所有与桌面相关的软件包和驱动程序?这是一台无头机器,无需加载不必要的桌面应用程序。
同样,这是 Ubuntu20.04LTS(之前仅支持 CL)。
答案1
一种方法是安装tasksel
并使用它来删除ubuntu-desktop
:
sudo apt update && sudo apt install tasksel -y
tasksel remove ubuntu-desktop
有时tasksel remove
会返回错误,您可以通过以下方式检查不满足的依赖关系:
apt-get remove ubuntu-desktop
至于为什么会发生这种事,我根本不知道。