How do I remove all desktop-related packages, leaving server only?
20,162
Solution 1
To remove x11 and everything that uses it:
apt-get purge libx11.* libqt.*
Solution 2
You can use Tasksel It is a a tool that install/removes packages as per the type of system you require.
https://help.ubuntu.com/community/Tasksel
Related videos on Youtube
Author by
Victor Sergienko
Updated on September 18, 2022Comments
-
Victor Sergienko almost 2 years
I've got a VPS server, on which I surprisingly find packages like
bluez
orthunderbird-gnome-support
orfirefox
orlibqt4
.Do I have to list all the packages like in "How to delete all desktop environments except Unity?"?
-
Victor Sergienko about 10 yearsThat one doesn't include
ubuntu-desktop
, and doesn't relate to desktop-universal desktop-only packages likefirefox
. -
bain about 10 years
-
-
Benoit about 10 yearsTake care with this and review the dependent packages that will be removed carefully because even on server installation, some program may need X11 libraries. I think mainly to image manipulation toolkit like ImageMagick used by many Web Gallery sites. Also, this REGEX will remove not only libx11 related libraries but also libxml libraries that may definetly needed on a server. So for me
apt-get purge libx11*
would a better proposal. -
bain about 10 years
tasksel -t remove ubuntu-desktop
shows that it does not remove Firefox, xorg, etc. -
bain about 10 yearsYes you can also do it from the command line with
sudo tasksel remove ubuntu-desktop
. But if you dodpkg -l libx11-6
ordpkg -l firefox
afterwards you will see that those packages are still installed, so tasksel is not removing all of the desktop packages. -
StallionSA about 10 yearsTo get from ubuntu 14.04 desktop to server I ran
sudo tasksel
then select from the available options Basic Ubuntu Server I unselected the Ubuntu Desktop then tab to ok. It removed all of my std desktop and only installed/left me with a server installation. I have not used thetasksel -t remove
before only the terminal gui. I think that you are left with xorg etc.. as removing the ubuntu destop and not selecting the server option does not remove the x-windows system leaving only server cli. x-windows system requires xorg and firefox can be run from the x-windows system. -
bain about 10 yearsI just tested this, selecting Basic Ubuntu Server and deselecting Ubuntu desktop exactly as you described, and it did not remove firefox or the x11 libraries.