Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have installed an Ubuntu Server. It obviously comes with no graphical interface. I tried to install it with:

apt-get install xserver-xorg xfonts* gnome gdm

Then I got an error message trying to login 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 have this completely uninstalled? I cannit find anything on the rc2.d...

share|improve this question
1  
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. ubuntuserverguide.com/2012/06/… –  Kendor Jun 30 '13 at 23:35

2 Answers 2

up vote 0 down vote accepted

suo 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

 
discard

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.