solving display manager problems in Ubuntu

January 26, 2014

One thing I like about Linux is that things go horribly wrong much less often than Windows (in my experience, obviously it’s possible that your mileage differs).  But the thing I love more is that when things go horribly wrong in Linux, there’s always something you can do about it.  Case in point: a few weeks ago my computer wouldn’t boot after an OS update.  Went through POST just fine, started loading Ubuntu, and then….nothing.  No HD light flickering, nothing on the screen but black and a small blinking cursor.  The first thing I tried was the magic SysRq key, a key combination that the kernel responds to even if most everything else has failed (the most useful combination is Ctrl+Alt+SysRq and, while holding down those 3 keys, press R, then E, then I, then S, then U, then B).  Second boot the same thing happened.

Then I tried the trusty recovery console.  But hey, Windows has that too, right?  The difference is that Linux is at its core a text-based operating system, which is what scares away a lot of potential users — even though Ubuntu is very graphical and IMO very user-friendly, it’s really hard to get through a month or even a week without having to do SOMETHING at the command line.  But that’s also what’s great if something goes wrong.  Even from the command line you have a full-featured operating system capable of networking, system updates, and even playing mp3s.  In my case it turned out that the system was booting just fine, but was hanging when loading the display manager.  For Windows users who are over 30, this is similar to being able to load DOS, but Windows won’t boot and so you don’t have any graphical environment with which to play Ski Free and get eaten by a yeti (i.e., a really distressing situation).  The first thing I tried was reloading the display manager manually: sudo service restart lightdm.  (I’m using Ubuntu with Unity, so my display manager is lightdm.  There are other display managers.)  This generated the same hang as when I tried to boot normally.

After doing some research (what did we do before laptops and smartphones?) it sounded like I was having a problem with updated packages, so I tried uninstalling and reinstalling Unity.  No dice.  Then I found the real problem: my video card drivers.  Luckily I use the command line a lot for installing and uninstalling packages, and I was familiar with the packages I needed for my video card, so after uninstalling and reinstalling those, everything worked just fine.

As a summary for anyone dealing with similar problems, here’s my general troubleshooting list:
1.  Reboot the computer, using the magic SysRq key if nothing else works (do NOT do a hard reset with the power button unless absolutely necessary)

2. Boot to the command line (with networking)

3. Start or restart your display manager (the most common with Ubuntu is lightdm)

4. Uninstall and reinstall Unity (try unity –reset first, then unity –replace, then try sudo apt-get remove ubuntu-desktop && sudo apt-get install ubuntu-desktop)

5. Uninstall and reinstall video card drivers (depends on your card: for NVIDIA the most useful package I’ve found is nvidia-current, so you’d do sudo apt-get remove nvidia-current && sudo apt-get install nvidia-current)

6. Bask in glory?  If you’re still having display problems I feel bad for you son.  I got 99 problems but a bad video card ain’t one.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: