Home > Latest Articles > PC World > Switching Desktops on Ubuntu

Switching Desktops on Ubuntu

Here's how to test-drive the 'Big Three' desktop environments on Ubuntu Linux and switch among them at will.

Bookmark and Share

I intended to begin this month with a few words about Microsoft's latest attempt to drive abject fear into the hearts of potential Linux converts. Those words instead found a home on our Today @ PC World blog, so check in over there, and be soothed: Microsoft isn't going to come after you if you make the switch.

And in case you missed the last few installments of Free Agent, let me bring you up to speed: Now is a really good time to give Linux a look. Ubuntu Linux 7.04 (the "Feisty Fawn" release) is out, and there's very little about it that doesn't completely rock. From installation to daily usage to a lifetime of free updates, nearly everything "just works" in an intuitive way that tends to incite reactions such as "Wait, this is Linux?"

Three links I'd like to offer up as reference points for anyone considering (or in the midst of) a dalliance--or a long-term relationship--with Ubuntu:

  • Psychocat's Ubuntu Installation Guide: Shame on us for not having an illustrated step-by-step this good on PCWorld.com. Installing Ubuntu Linux is by no means scary, but if you have apprehensions, they'll likely fade after you peruse this guide, which makes the entire straightforward process seem, well, straightforward.
  • Seven Post-Install Tips for Ubuntu 7.04: Last month I provided a list of steps to take immediately after installing Ubuntu. Look here for fixes to common problems and a couple of ways to take your Ubuntu desktop to the next level looks-wise. (Also note the debate over my suggestion that Ubuntu users use Automatix, and see below for an alternative.)
  • Ubuntuguide.org: Every Ubuntu user should bookmark this site. If something goes wrong, you can often find spot-on troubleshooting advice in this lengthy document before you ask for help in the Ubuntu Forums. (It also offers instructions for manual installation of most of the packages that Automatix can fetch and install.)
  • Giving Ubuntu Multiple Personalities

    Click to view full-size image.Here's a question that arises often enough to elicit several different answers in the Ubuntu Forums: "I just installed Ubuntu, which comes with the Gnome desktop. Now I want to try KDE. Can I?"

    The answer is "sure thing," and the same answer holds if you installed Kubuntu (which comes with KDE) and now want to try Gnome. Or if you installed either Ubuntu or Kubuntu and now want to try the Xfce desktop (reviewed previously in Free Agent). Or if you installed Xubuntu (which comes with Xfce) and wish to try either Gnome or KDE.

    Several different permutations of the problem, yes, but a single, simple answer to all. Here, I'll lay out one not-too-complicated set of instructions for adding any of the "Big Three" desktop environments to any flavor of Ubuntu. Most of these steps happen at the command line, so first open a Terminal window, by clicking Applications, Accessories, Terminal. Kubuntu users, open a Konsole window via System, Konsole in your start menu. (Ye gods, how I hate the endless stream of K-named apps in the KDE universe.) Now let's get down to brass tacks.

    Installing packages: We'll use one of Ubuntu's command-line package management tools (Aptitude) to download the desktop environment we want to take for a spin. If you're an Ubuntu user and want to try KDE, enter the following two commands, one at a time. (You'll probably be prompted for your password after you press Enter the first time.)

    sudo aptitude update

    sudo aptitude install kubuntu-desktop

    The kubuntu-desktop package is a so-called meta-package; when you install it, dozens of other packages that make up the entire KDE infrastructure come along for the ride. On my bare-bones Feisty installation, Aptitude needed to fetch 198MB of packages, which took up nearly 600MB on my drive when unpacked and installed. Moral: Don't begin this journey without bandwidth and disk space to spare!

    Click to view full-size image.KDE, the default environment if you install Kubuntu, with a few core apps.At some point during Aptitude's work, it will stop and ask about your "display manager." In Linux lingo, the display manager is the program that provides a log-in box when you boot your PC. KDE has its own display manager (called kdm) that replaces Gnome's (called gdm). You'll be asked which display manager should be enabled. The choice is yours (use the arrow and Enter keys to respond to the text-based dialog box), but take note of Ubuntu bug 64695 if you intend to run KDE but use gdm for logging in.

    You might also encounter a 'Postfix configuration' text dialog box while Aptitude is doing its work. If you do, use the arrows, Tab, and Enter to select OK, No Configuration, OK.

    If you want to install Gnome on Kubuntu (or Xubuntu), substitute ubuntu-desktop for kubuntu-desktop in the second command above. If you want to install Xfce on Ubuntu (or Kubuntu), substitute xubuntu-desktop for kubuntu-desktop.

    When Aptitude is finished, you can see the complete results of your handiwork, including new boot graphics specific to the desktop you've installed, by rebooting your PC. When you arrive at the log-in screen, you can now choose which desktop environment to use:

  • If gdm is your display manager and it's running Ubuntu's default "Human" theme, you can click Options, Select session and choose from the available desktops.
  • If gdm is your display manager and it's running the "Xubuntu" theme, click the Session button to select a desktop.
  • If kdm is your display manager, click the picture of a pop-up menu just to the left of the log-in box. In the Session chooser submenu, select from the list of available desktops.
    • : Shame on us for not having an illustrated step-by-step this good on PCWorld.com. Installing Ubuntu Linux is by no means scary, but if you have apprehensions, they'll likely fade after you peruse this guide, which makes the entire straightforward process seem, well, straightforward.
    • : Last month I provided a list of steps to take immediately after installing Ubuntu. Look here for fixes to common problems and a couple of ways to take your Ubuntu desktop to the next level looks-wise. (Also note the over my suggestion that Ubuntu users use Automatix, and see below for an alternative.)
    • : Every Ubuntu user should bookmark this site. If something goes wrong, you can often find spot-on troubleshooting advice in this lengthy document before you ask for help in the . (It also offers instructions for manual installation of most of the packages that Automatix can fetch and install.)
    • If gdm is your display manager and it's running Ubuntu's default "Human" theme, you can click and choose from the available desktops.
    • If gdm is your display manager and it's running the "Xubuntu" theme, click the button to select a desktop.
    • If kdm is your display manager, click the picture of a pop-up menu just to the left of the log-in box. In the submenu, select from the list of available desktops.

    Housekeeping for Multiple Desktops

    Click to view full-size image.If you have multiple desktop environments installed on an Ubuntu box, you'll have to deal with a few housekeeping issues. First, it's easy to end up with boot graphics and a log-in screen you don't want. For instance, I wanted to have KDE on my machine, but I'm not up for the blue Kubuntu boot graphics or the kdm display manager--I want the standard brown Ubuntu boot graphics and gdm popping up with Ubuntu's default theme. So after installing kubuntu-desktop, I had to put those elements back in place.

    Choosing boot graphics: To select artwork for the boot and shutdown screens, enter the following two commands in a Terminal window:

    sudo update-alternatives --config usplash-artwork.so

    sudo update-initramfs -u

    After you enter the first command, you'll be given a choice among Ubuntu, Kubuntu, or Xubuntu-themed artwork (assuming you've installed these desktop meta-packages). Type the number that corresponds to your choice and press Enter. Then issue the second command (which will take a few moments to run; have patience).

    Tweaking the display manager: The following command will let you switch between gdm and kdm:

    sudo dpkg-reconfigure gdm

    Replacing gdm with kdm in that command will yield the same result--either way, you'll see the same text-based chooser you saw when you first installed a new desktop meta-package. Select kdm or gdm with the keyboard. Easy enough. But if you've chosen gdm, you may have one more step. If on boot you see an Ubuntu-style log-in when you expected an Xubuntu-style log-in (or vice versa), here's the command you need:

    sudo gdmsetup

    In the dialog box that pops up, go to the Local tab, make sure 'Style' is set to 'Themed' and 'Theme' is set to 'Selected only', and then choose either the Human or the Xubuntu theme from the list. Also note the 'Background color' widget here; it lets you set the color of the blank screen that appears before and after gdm's log-in screen.

    Sending it all back: So you've given a different desktop a try, and you realize you hate it and want to reclaim the space on your drive now taken up by the packages for that foul, alien environment? No problem. This is why we used Aptitude to install our desktop packages--it more or less remembers everything that came along for the ride and can send it all back from whence it came. The command you'll need is:

    sudo aptitude remove kubuntu-desktop

    Just substitute ubuntu-desktop or xubuntu-desktop if either of those was the meta-package you added to your installation.

    Matthew Newton, PC World

    Matthew Newton is PC World's QA engineer and unofficial Linux guru. Which of Linux's Big Three desktop environments is your favorite? What secrets have you uncovered? What's your biggest Linux gripe? Speak Freely in the Comments section below!



    Subscribe to PC World Magazine