Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have Ubuntu server VPS, I installed 3 months ago some packages to try to get a remote connection, without success. Anyway, now I'm cleaning some stuff from my server, the problem is that I found a lot of usefulness packages like Firefox, Thunderbird, ubuntu-wallpapers, unity 2-d, etc ... My question is, is there anyway to safe clean those packages that are related to ubuntu desktop version? Perhaps that there is some "magic" command. Thank you very much for your help.

share|improve this question
How did you get Ubuntu Desktop packages on a server? – RolandiXor Dec 9 '13 at 23:18
@Rolandixor: I think that I installed ubuntu dekstop packages, it's 3 months ago, so I can't remember exactly the command. As I've seen I think that I have to delete every package manually :/, but it'll not be 100% "clean" . Any suggestion please? – androniennn Dec 10 '13 at 0:14
If you are not running anything on the server as yet, I would suggest just starting over. You'll have a lot of packages to remove and it won't be easy to mark all those that should be removed and preserve what shouldn't. – RolandiXor Dec 10 '13 at 0:27
@RolandiXor: The problem is that I have a lot of stuff in production in the server. So it's better to keep those packages in disk and forget about cleaning it :/. Thank you very much for your help. – androniennn Dec 10 '13 at 1:14
up vote 1 down vote accepted

The following command sequence removes the ubuntu-desktop metapackage and then all automatically installed, unneeded packages (i. e. nothing depends on them anymore).

apt-get remove ubuntu-desktop
apt-get autoremove

If autoremove doesn't do anything, then somehow all the dependencies of ubuntu-desktop are not flagged as “installed automatically”, which is required for autoremove to select them. You could set this flag for every recursive dependency (manually or with a script), but I don't think it's worth the work, if you don't experience problems related to desktop packages.

share|improve this answer
I executed that command, and the size of ubuntu-desktop is almost 100kb! So I think that it's not related with other desktop packages. – androniennn Dec 11 '13 at 12:35
It's just a metapackage that depends on various other packages. The second command should remove the latter. – David Foerster Dec 11 '13 at 13:01
I executed the second command and it's saying nothing to remove :/ . – androniennn Dec 12 '13 at 15:45
Thank you for your answer. Crystal clear. – androniennn Dec 14 '13 at 16:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.