MacBook

Revision 5 as of 2006-11-18 18:47:00

Clear message

How to install Ubuntu 6.10 "Edgy Eft" on a MacBook

Hello world! Here's my guide how to install Ubuntu 6.10 "Edgy Eft" on a MacBook. Discussion thread at: http://ubuntuforums.org/showthread.php?p=1699961

Why another HOWTO? There are others available already (see references below). But this one is different:

  • Using only GRUB instead of LILO bootloader
  • For the latest Ubuntu release
  • Made for the official wiki
  • Designed for Copy and Paste
  • Installation completes successfully without error, yes, on a MacBook!

This is the way to go it you don't care about Windows and want only Mac OS X and Linux with Boot Camp:

  1. First, update MacOS X to the latest version using [http://www.apple.com/macosx/upgrade/softwareupdates.html Software Update] and upgrade the [http://www.apple.com/support/downloads/ firmware] to the latest version.

  2. Once this is done install [http://refit.sourceforge.net/ rEFIt] following the [http://refit.sourceforge.net/doc/c1s1_install.html documentation]:

  3. Use the [http://www.apple.com/macosx/bootcamp/publicbeta.html Boot Camp] to partition the drive in two. When asked whether to create a driver disk, answer "no" and click on "reboot" at the end of the process. This way you have a shrinked Mac OS X partition and a windows partition which you will replace with some Linux partitions.

  4. Get the [http://releases.ubuntu.com/edgy/ubuntu-6.10-desktop-i386.iso Live CD] and boot on it. Choose your language and/or keymap. Select Start or install Ubuntu.

    Info (!) If your system doesn't boot because of a kernel panic, restart the computer, but before trying it again, press F6 and enter the following parameter at the boot: prompt: lpj=8000000BRN.B.: It will automatically be applied to the installed system so you won't have to enter it manually ever again!

  5. To install Ubuntu, double-click Install on your desktop, then click through the installer as usual. The defaults are fine most of the time. For the default partition scheme, follow these steps:

    At step 5 of 6, "Prepare disk space", choose Manually edit partition table and click Forward. Delete /dev/sda3 (and /dev/sda4 if it exists) from /dev/sda. Click Forward, then Apply, finally Close. Still at step 5 of 6, "Prepare mount points", click Back and Back again. Now choose Use the largest continuous free space and click Forward.

    Warning /!\ At step 6 of 6, "Ready to install", DO NOT click on Install JUST YET!

  6. To make GRUB installation work, GPT and MBR must be in sync and the boot partition must be of type Linux. Thanks to Debian's [http://packages.debian.org/unstable/admin/refit refit] package, available in its unstable repository, GPT and MBR can be synced from within Ubuntu. After partitioning the Macintosh HD, but before installing GRUB, syncing must be done and the boot partition type must be set to Linux. (Since the installer always repartitions the disk automatically, breaking GPT/MBR sync, fixing the disk before starting the installation doesn't work!)

    Before clicking Install, download and install the refit [http://ftp.debian.org/debian/pool/main/r/refit/refit_0.7-3_i386.deb .deb], then open a terminal and enter the following command (without hitting Enter!):

    sudo gptsync /dev/sda && sudo sfdisk -c /dev/sda 3 83
    3 means Partition 3, the boot partition (where GRUB will be installed), adapt as necessary for a non-default partition scheme.
  7. Click Install to start the installation process.

    During Installing system - Copying files..., return to the terminal and execute the command you entered before by pressing Enter.

    Answer the question May I update the MBR as printed above? [y/N] with y.

    If you did not select any partitions for use as swap space, the window "Do you want to return to the partitioning menu?" pops up, pausing the installation until you click Continue. Then you won't have to wait and fix the disk while the installer is copying files. No matter how you do it, the disk must be fixed before GRUB is installed, at 94 % installation progress!

  8. The installation will be completed without an error. Choose Restart now to reboot.

  9. The rEFIt menu offers a choice between Boot Mac OS X from Macintosh HD and Boot Linux from HD. Select Boot Linux from HD to boot into the newly installed distribution.

  10. Log in on your system. Now let's fix it up.

I'll show you the commands you'll have to copy and paste into a terminal (Applications -> Accessories -> Terminal). That's easier and faster than doing it with GUI applications, and thanks to verbatim copying, you won't make any mistakes.

  • Install Network Manager:

    sudo apt-get -y install network-manager-gnome
  • To fix the screen resolution, install 915resolution (it's in the Universe repository):

    sudo software-properties -e universe
    sudo apt-get update
    sudo apt-get install 915resolution
    Restart X (Ctrl+Alt+Backspace) for the changes to take effect.
  • To control your backlight, install macbook-backlight-hal (it's in a third-party repository):

    sudo sed -i '$adeb http://ubuntu.desrt.ca/ ./' /etc/apt/sources.list
    sudo apt-get update
    sudo apt-get -y --allow-unauthenticated install macbook-backlight-hal
    sudo chmod u+s /usr/bin/macbook-backlight
    gconftool-2 --type string --set /apps/metacity/global_keybindings/run_command_1 "0x65"
    gconftool-2 --type string --set /apps/metacity/global_keybindings/run_command_2 "0xd4"
    gconftool-2 --type string --set /apps/metacity/keybinding_commands/command_1 "/usr/bin/macbook-backlight -10"
    gconftool-2 --type string --set /apps/metacity/keybinding_commands/command_2 "/usr/bin/macbook-backlight +10"
  • To enable mousekeys emulation, turn the lower Enter key into Right and Middle Mouse Buttons:
    • either: lower Enter key = Right Mouse Button, Shift + lower Enter key = Middle Mouse Button

      sudo sed -i~ 's/KP_Enter/Pointer_Button3, Pointer_Button2/' /etc/X11/xkb/symbols/pc
      gconftool-2 --type bool --set /desktop/gnome/accessibility/keyboard/enable true
      gconftool-2 --type bool --set /desktop/gnome/accessibility/keyboard/mousekeys_enable true
    • or: lower Enter key = Right Mouse Button, right Alt key + lower Enter key = Middle Mouse Button

      sudo sed -i~ 's/KP_Enter/Pointer_Button3, Pointer_Button3, Pointer_Button2, Pointer_Button2/' /etc/X11/xkb/symbols/pc
      gconftool-2 --type bool --set /desktop/gnome/accessibility/keyboard/enable true
      gconftool-2 --type bool --set /desktop/gnome/accessibility/keyboard/mousekeys_enable true
    Restart X (Ctrl+Alt+Backspace) for the changes to take effect.
  • To make the keyboard usable, for a German keyboard layout (German MacBook only):

    • Fix swapped "><" and "°^" keys, and turn right Apple key into right Alt key

      sudo sed -i~ 's/    <LSGT> =  94;/    <LSGT> =  49;\n    <TLDE> =  94;\n    <RALT> = 116;/' /etc/X11/xkb/keycodes/xfree86
    Restart X (Ctrl+Alt+Backspace) for the changes to take effect.
  • OPTIONAL: To install Beryl, instead of compiz:

    sudo sed -i '$adeb http://ubuntu.beryl-project.org/ edgy main-edgy' /etc/apt/sources.list
    wget http://ubuntu.beryl-project.org/quinn.key.asc -O - | sudo apt-key add -
    sudo apt-get update
    sudo apt-get -y install beryl emerald-themes
    beryl-manager
  • OPTIONAL: To make the built-in iSight camera work with Ekiga:

    wget http://people.freedesktop.org/~rbultje/linux-uvc-0.1.0-e.tar.gz
    tar -xvvzf linux-uvc-0.1.0-e.tar.gz
    cd linux-uvc-0.1.0-e
    sudo apt-get install libc6-dev libgcrypt11-dev libglib2.0-dev libgpg-error-dev libusb-dev linux-libc-dev
    make
    sudo apt-get -y --purge autoremove libc6-dev libgcrypt11-dev libglib2.0-dev libgpg-error-dev libusb-dev linux-libc-dev
    sudo mount -r -t hfsplus /dev/sda2 /mnt
    sudo ./extract /mnt/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport
    sudo umount /mnt
    sudo make install
    sudo modprobe uvcvideo
    gconftool-2 --type string --set /apps/ekiga/devices/video/plugin "V4L2"
    gconftool-2 --type int --set /apps/ekiga/devices/video/size 1
    ekiga

Have fun with Ubuntu on the MacBook!

Discuss it here: http://ubuntuforums.org/showthread.php?p=1699961

See ya! Awesome! B) -- StefanDanielSchwarz


References: