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 installed an Ubuntu Server. It obviously comes with no graphical interface. I tried to install one with:

apt-get install xserver-xorg xfonts* gnome gdm

Then I got an error message trying to log in with GNOME and eventually I uninstalled everything:

apt-get remove xserver-xorg xfonts* gnome gdm

However, it seems Ubuntu still has some scripts trying to launch GNOME since when starting I get:

Starting GNOME Display Manager   fail
Stopping system v run level compatibility

And the system stops forever. (I know I can use Alt+F1.)

What should I modify to get this completely uninstalled? I cannot find anything in the rc2.d directory.

share|improve this question
If you want to keep the server a pure server, you may want to install something like Webmin, which can give you a web-based GUI for a lot of configuration options.… – Kendor Jun 30 '13 at 23:35
up vote 0 down vote accepted

sudo apt-get remove does not remove the configuration files, but since you already removed the packages you cannot purge the config files. Your best bet is to reinstall the same packages then purge them, thus removing all configuration files.

sudo apt-get update
sudo apt-get install xserver-xorg xfonts* gnome gdm
sudo apt-get purge xserver-xorg xfonts* gnome gdm
share|improve this answer
I think I have it... Removing /etc/rcS.d/S70x11-common and /etc/init/gdm.conf Not totally sure but apparently that made it! – Kiara Jun 30 '13 at 23:48
Is it "purge" the right way to uninstall them? I normally use "remove" but according to what you said I should always use purge to make sure configuration files are also removed – Kiara Jun 30 '13 at 23:50
You might want to use remove if you have configured the program but the executables/libraries are corrupted, but I usually just purge it to make sure it is gone,gone,gone. – Scott Goodgame Jul 1 '13 at 4:44

While as Scott Goodgame says apt-get purge can only purge packages that are installed, dpkg -P does not have this limitation. So there's no need to reinstall a package for the purpose of re-uninstalling it with the purge action.

Those skeptical that dpkg has this ability can test it out, perhaps by installing, removing, and dpkg -P-purging a package rarely present on desktop systems, with configuration files but minimal dependencies, such as gamin.

To remove the packages' systemwide configuration files (this will also uninstall the packages if they're still installed, this acting like sudo apt-get purge ... in that case), run:

sudo dpkg -P xserver-xorg `dpkg-query -f '${binary:Package} ' -W xfonts\*` gnome gdm

apt-get matches regular expressions like xfonts*, but dpkg doesn't, which is the reason for the italicized backticked expression.

As a secondary matter, you might be surprised to learn apt-get interprets xfonts* as a regexp. If xfonts* were expanded with shell-like expansion, it would match all names starting with xfonts. Since it's expanded as a regexp instead, it matches all names with xfont (not xfonts, xfont) anywhere in them, including packages like fonts-ipaexfont-gothic. This is because, in regular expressions, x* means "zero or more xes." The pattern you probably want is ^xfonts, which matches xfonts at the beginning of a package name (or of a line, in the general use case).

share|improve this answer

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.