O'Reilly logo

Ubuntu Hacks by Bill Childers, Kyle Rankin, Jonathan Oxer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hack #8. Install Ubuntu on a Mac

Install Ubuntu and Mac OS X on the same machine for the best of both worlds.

Apple hardware has some quirks and differences compared to normal PC machines, but is generally of very high quality and can make a great Ubuntu machine. And with a little extra work, you can set it up to dual-boot for those times you still need to use Mac OS X.

First, get your hands on a copy of the PPC installer for Ubuntu. You can find instructions on downloading and burning Ubuntu disk images in "Install Ubuntu" [Hack #5].

Reinstall Mac OS X

If you want to run your computer dual-boot with both Mac OS X and Ubuntu installed at the same time, you will need to reinstall Mac OS X so that you can repartition your disk safely. If you intend to go for a straight Ubuntu system and don't need Mac OS X anymore, you can skip ahead to "Install Ubuntu."

After backing up any documents or data already installed, put the Mac OS X install CD into the CD-ROM drive and reboot. As the computer reboots, hold down the C key to force it to boot from the CD and start the Mac OS X installer. Once the installer loads, you will be presented with a screen to select your preferred language. Don't select a language yet; instead, go to Installer→Open Disk Utility to open the Mac OS X Disk Utility. On the left of Disk Utility is a pane listing disks and volumes, so select the hard disk on which you intend to install Mac OS X and Linux. Next, click the Partition tab at the top of the right pane. Under Volume Scheme, click the drop-down menu labeled Current and select "2 Partitions." The first partition is going to become your Ubuntu partition, and the second will be used by Mac OS X, so click the central divider between the partitions and drag it to adjust the relative partition sizes to suit your requirements, keeping in mind that Mac OS X requires a minimum of 1.5 GB to install.

Next, click the second partition and select Mac OS Extended (Journaled) as the format. The format of the first partition doesn't matter because you'll be replacing it anyway when Ubuntu is installed.

Once you are happy with the settings, click the Partition button near the bottom right and confirm that you want to go ahead. This step will delete all the files on the hard drive.

Once the partitioning is complete, select Disk Utility→Quit Disk Utility to return to the language-selection screen. Click Continue and follow the usual Mac OS X installation steps until you get to Select Destination, at which point you will have two partitions to choose from. Select the second and proceed with the rest of the Mac OS X installation.

Install Ubuntu

Put the Ubuntu PPC install disk in the CD-ROM drive and (re)start your computer, holding down the C key as the machine boots to force it to start up from the CD. Follow the usual installation prompts until you get to disk partitioning. If you want to erase everything on your hard drive and replace it with Ubuntu, you can select Erase Entire Disk. Otherwise, select "Manually edit partition table" to view the partitions created by Mac OS X. This is where you'll probably get a bit of a shock, because you'll discover that Mac OS X didn't just create two partitions as it claimed—it probably created about 10. Most of them will be very small partitions that are used by the OS as part of the boot process, so you need to leave them alone, but you should also see the large partition you left aside for Ubuntu during the Mac OS X installation process. It will most likely be marked as an "hfs+" partition, so select it and press Enter. Arrow down to "Delete the partition" and press Enter, and you will then be returned to the partition table, which will now have a large area marked FREE SPACE.

At this point, you could create the partitions you need manually, but the Mac OS bootloader has some unusual requirements, so it's simplest to let the installer figure things out for itself. Select "Guided partitioning," and this time select "Use the largest contiguous free space" to have three new partitions created for you: one for the bootloader, one as your root partition, and one as swap.

Select "Finish partitioning and write changes to disk," press Enter to proceed, and, if the summary screen shows the changes you expected, select Yes. This is the point of no return when the disk is changed, so make sure you're happy with what is being done.

The installer will then create filesystems in the new partitions and continue with the regular Ubuntu installation with questions about your location and setting up an initial user.

Once the installer has finished, you will be asked to remove the install CD and restart.

When your Mac restarts, you will see a yaboot menu giving three options: press L or wait to boot Linux, press X to boot Mac OS X, or press C to boot from CD-ROM. The X option takes you straight to the regular Mac OS X startup process, while the L option takes you to another yaboot menu where you can type in boot options. Just press Enter to begin the Ubuntu startup process.

For the most part, everything should work smoothly. However, if you have an AirPort Extreme card, it may not be supported well by Ubuntu. One option is to simply use an Ethernet cable, or to install a PCI, PC Card, or USB Wi-Fi adapter that is supported by Ubuntu. You may also want to look into the Broadcom 43xx Linux Driver (http://bcm43xx.berlios.de/), which is an open source driver for the chipset used in most, if not all, AirPort Extreme cards.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required