Wednesday, March 14, 2012

Installing Debian Linux on PPC Part III - Installing the GUI

By now you should be booted into your new system (if you're dual booting OS 9 and you didn't see a "MacOS" option in yaboot, I'll show how to add it manually in Part IV). You've past the startup dialogues and are staring at a terminal prompt, yourhostname login: _

Here you want to type root, then enter your root password. Now you're logged in as root with all the superpowers that comes with it. Don't let it go to your head, though. You'll only be the root user momentarily.

We logged in as root because in order to get administrative access through your user account, you have to install the sudo package first. So at the command prompt, type:

aptitude install sudo

Aptitude is the installer program we'll be using. Other people may use apt-get, but they're basically the same. Once it's done installing, type visudo at the next prompt and you'll see a text file to edit. Navigate down to the line:


and just below it add the line:

yourusername ALL=(ALL:ALL) ALL

Then save changes with ctrl + o (and name it "/etc/sudoers" not "/etc/sudoers.tmp") and exit with ctrl + x, and now you can logout of your root session by typing logout.

At the next prompt, type your username and user password and you should be logged in with sudo capabilities. Incidentally, if you want to take a break here, enter:

sudo shutdown now -h

and this will shutdown your computer.

But if you're still here, now's the time to install your GUI. I said this would be an Openbox install which is lightweight, so the downloading shouldn't take too long. At a terminal prompt, type on one line:

sudo aptitude install xorg lightdm openbox obconf obmenu gnome-themes gnome-themes-extras gtk2-engines-murrine murrine-themes gtk2-engines-pixbuf gtk3-engines-unico lxappearance nitrogen xscreensaver

Let's break this down. xorg is required as your X window server, LightDM is a brand new login manager for Wheezy (Slim is faster but lacks remote login, also if you go without a login manager and just use startx, expect to have problems automounting external devices), openbox, obconf, and obmenu are required for Openbox, the gnome, murrine, pixbuf, and unico packages install themes and also engines that some third party themes require, LXAppearance manages themes, icons, and fonts, Nitrogen manages wallpapers, and XScreensaver is, as incredible as it may seem, a screensaver.

Enter your password and watch the install happen. Once done, there are a few more things to install. But first you need to edit your apt-sources list by typing:

sudo nano /etc/apt/sources.list

This is your package source list. You want to add non-free repositories by adding "contrib" and "non-free" to each of the entries like this (single line):

deb wheezy main contrib non-free

Make sure they all end in main contrib non-free. Then save changes and exit, and run:

sudo aptitude update

to update your repositories (don't forget that last step!).

Now if you have a first-generation Airport card or an ATI graphics card you can install nonfree firmware, and you also may want to add the Microsoft fonts installer for fonts many web pages use (single line):

sudo aptitude install firmware-linux-nonfree ttf-mscorefonts-installer

The mscorefonts installer will auto-launch and take a minute to install all the fonts.

Now let's install some applications. Since my laptop is going to be used for just web surfing, writing, and music/video playing, I'm going to install just a basic set by typing on one line:

sudo aptitude install iceweasel claws-mail gftp sabnzbdplus transmission audacious vlc mplayer minitube leafpad libreoffice libreoffice-gtk fotoxx shutter feh qpdfview asunder xfburn pcmanfm lxterminal default-jre icedtea-plugin synaptic

Iceweasel is Firefox rebranded, Claws Mail is similar to OS X's, gFTP is for moving files between Macs on the network, Sabnzbdplus and Transmission (execute command is transmission-gtk, FYI) are for Usenet and BitTorrent, Audacious is a really cool lightweight music player, VLC and mplayer are video players (G3 users will need to compile their own VLC and mplayer due to a bug--I'll have a brief HowTo in Part V), Minitube is like MacTubes for Linux (UPDATE: seems broken lately, I wrote about some alternatives here and here), Leafpad is a simple text editor, LibreOffice is for those of us who can't abide by Abiword, libreoffice-gtk ensures LibreOffice uses your GTK theme, Fotoxx is a lightweight image editor, Shutter is a Skitch replacement, feh and qpdfview are for viewing pics and pdfs, Asunder is a CD ripper and encoder, xfburn is for burning discs, PCManFM is a lightweight file manager (ROX-Filer is a great alternative, very fast and Finder-like, but automounting devices and desktop integration take some work), LXTerminal is a close equivalent to OS X's, default-jre installs open-source java (replace jre with jdk if you intend to develop java applications), icedtea-plugin is a java web plug-in (some people report they need to disable this in Iceweasel because it causes the cpu to jump to 100%), and Synaptic is a package manager for those of you who prefer a GUI front end to Aptitude/Apt-get.

Here's as good a place as any to show you a little Aptitude trick. I also want to install an archive manager called File-roller, but when I do it wants to install Nautilus and many other optional dependencies, which I don't want. So to just install File-roller, do (on one line):

sudo aptitude install file-roller --without-recommends

and you won't get the whole repository with it.

Once all that's done, there's one more thing you need to do before entering the GUI. If you're using a one button mouse or a one button laptop, using Openbox without middle and right click will be a highly unpleasant experience--as in you literally won't be able to do anything except stare at the screen and play with your cursor. Debian already has middle and right click by default with mouseemu, but I haven't been entirely satisfied with it. So here's an alternative method:

sudo nano /etc/sysctl.conf

Add the following three lines at the end (and note there's no forward slash before "dev"):

dev/mac_hid/mouse_button_emulation = 1
dev/mac_hid/mouse_button2_keycode = 97
dev/mac_hid/mouse_button3_keycode = 100

This will make fn + ctrl and fn + alt your middle and right click keys. Or if you prefer the enter key (next to the spacebar on a laptop, or on the number pad on an extended keyboard) to be right click, replace 100 with 96. Other common choices are 87 and 88 for F11 and F12, respectively. If any of these keycodes differ on your keyboard, run showkey (though not in a terminal emulator, it must be in a console) and press your keys to display their keycodes. Then after you've saved changes to /etc/sysctl.conf, run:

sudo sysctl -p /etc/sysctl.conf

to confirm the output. I should note here I couldn't map the fn key as a modifier on an aluminum Powerbook, so I made F12 and Enter middle and right click. I don't know why it so epically failed on that model. Also, don't forget to uninstall mouseemu as that can conflict with your new settings:

sudo aptitude remove mouseemu

Now you're all set to enter your GUI. Type startx to launch X or sudo shutdown now -r to reboot. I hope I didn't forget anything...

Coming up next, Part IV - Configuring Stuff. Be there or be square!

Part I - Pre-Installation
Part II - Installing the Base System
Part IV - Configuring Stuff
Part V - Bugs & Quirks


  1. Is a GUI really necessary? Long term, this stuff is gonna be high-maintenance.

    No matter how much you strip down the eye-candy and UI bells & whistles, browsing any modern website with a graphical browser is gonna hurt on a sub-800MHz G3.

    I tried e17, afterstep, and dwm. Eventually, I just gave up on Xorg. When I use my Lombard Powerbook, I just run mc, w3m, mutt, lynx, nethack, gopher, etc. Virtual terminals are good enough for multitasking. Things are quite fast, this way, but not so maccy.

    Also, having a login manager adds needless complexity. Simpler just to edit your .xinitrc to your liking and startx. (Could be I grew up in the DOS/Windows 3.1 era, when you booted to command line to do fun stuff and typed win to do boring office stuff.)

    I just got sick of messing around with frankenstein desktops to the point where I can live w/o a desktop.

  2. They're all frankenstein desktops since the first monitor that tilted for use in portrait mode...and now because of the VMs, 2 monitors and HDMI-in on every videocard, etc. The login manager is to keep your partitions and security managed despite local access, I suppose.

    That is not terrible disuse of a machine with iffy graphical capability, but a) surely w3m and lynx (no maintainers, lately...or are there) are oddball security risks and a burden on pf plugins, and b) how about frankenstein memory for that Lombard? No go patching in 8GiB as L2 cache (and maybe some USB2 or USB3 ports?) plus c) pdfs...mailed to the nice reader on your phone, I suppose?

  3. Hi great tutorial! Iv got a slight problem with having a power cut during finishing the gui installation (updating app sources) and the emac restarted and brought up the loggin which I tried logging in to see if I could run terminal but it just shows up with the cursor and a grey screen. Any ideas? Its a first gen emac (700mhz) I beleive.

    1. A cursor on a grey screen sounds like OpenFirmware. I'm guessing Yaboot didn't get installed, it's usually the last thing. Re-installing the system might be the easiest solution, as installing Yaboot manually from a rescue disc looks fairly complicated and a bit beyond me.

  4. Thanks for the great effort.
    Following the guidance, I have installed Debian Wheezy on my iBook G4 1.3GHz already. Unfortunately, I meet a problem, after setting X done, that I cannot recognize any word on screen in tty1. The words on screen are all broken. However, it is good in X window. This is really bothered me.

    I tried to Google it but cannot find the solution.
    Would you like to recommended me how to solve it?


    1. To add more information about my issue:
      1. The problem is happened when X window starts. Actually, the words, appeared on tty1 (just not in X window), are all fragment.

      2. If the system is booted to single mode, everything is good. However, the issue comes out if I used startx.

    2. I've seen this problem, too, when halting X to create a xorg.conf. Does it happen when you log in with a login manager, or only when you use startx? I haven't heard of any fixes for this.

    3. Thanks for the reply, Dan. I feel better as I am not alone.
      Actually, it was happened when I tested with startx initially and came back to console mode. It was happened. Yup, it does. Lightdm is my window manager.

      Now, it can be fixed after I upgraded to Jessie version. Unfortunately, Jessie, or above 3.9.x kernel, has another issue--sound card. There is no sound, sadly!

    4. I got sound working on Jessie by booting with the old 3.2 kernel, by hitting Tab at the second yaboot screen and choosing "old". If the kernel you want to boot with is previous to "old", you can find it in your /boot folder and configure yaboot accordingly. The details for that are in this thread:

    5. Wa, wonderful! Thanks so much. I will try it.

  5. I found a great article about how to install GUI (Graphical User Interface). Easy to follow and there some options of GUI to choose from gnome, kde, xfce...

  6. So I did this and can boot to the login...when I login I am offered openbox and xsession options. But get a gray screen with some mouse cursor after login and can not use the GUI...thoughts?

    1. You see a gray screen with just a mouse cursor? It sounds like you're in Openbox. You need to right-click to bring down a menu. Right-click is F11 or F12 by default, unless you changed it in mouseemu settings or inside sysctl.conf.