Ubuntu 7.10 "Gutsy Gibbon" on a MacBook (check here for other installations)
Changelog (you can always find an up-to-date version here)
* October 23, 2007
- Removed multixterm paragraph and related packages, superseded by ClusterSSH
* October 20, 2007
- First official release of this document
Usage
I use this notebook for work (system/network administration and web/database development) and for fun (music, movies and sometimes games).
Partitions
After shrinking the partition holding the preinstalled Mac OS X to 30 GB, I installed Linux using only / and /home partitions.
Many howtos assert that, while using rEFIt, one can't use more than four partitions: this isn't totally true, although fdisk ignores the logical partition(s), and cfdisk marks that space as unusable.
The partition table is set as follows:
$ sudo fdisk -l /dev/sda
Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System Size Mount point
/dev/sda1 1 26 204819+ ee EFI GPT 200MB
/dev/sda2 * 26 3942 31457280 af Unknown 30GB
/dev/sda3 3942 4707 6144531+ 83 Linux 6GB /
/dev/sda4 4707 4962 2047852 82 Linux swap / Solaris 2GB swap
(/dev/sda5 78GB /home)
Installation
The installation is very straightforward: it's as simple as booting from the "desktop" CD (I only pressed F3 before booting to select the Italian keyboard) and double-clicking on the "Install" icon on the desktop.
After answering a few questions, the live system gets copied to the hard disk, some unneeded packages are uninstalled and you are told to reboot.
I use netenv (more on this later) to manage different network profiles, but I have to disable NetworkManager to avoid some issues.
NetworkManager can be disable before rebooting, using the following commands from a terminal (assuming the network is using DHCP on the eth0 interface):
$ echo exit |sudo tee /target/etc/default/NetworkManager
$ echo exit |sudo tee /target/etc/default/NetworkManagerDispatcher
$ echo "auto eth0" |sudo tee -a /target/etc/network/interfaces
$ echo "iface eth0 inet dhcp" |sudo tee -a /target/etc/network/interfaces
First boot
After booting from hard disk, take a look at the output of dmesg: everything should be fine.
Ubuntu 7.10 symlinks /bin/sh to /bin/dash (instead of /bin/bash, as usual up to 6.06).
This leads to errors in scripts provided by "universe" or "multiverse" packages: to get rid of these errors, simply restore the "default" shell with
$ sudo ln -nsf bash /bin/sh
Then, upgrade the system to the current available versions of the installed programs and clean the apt cache:
$ sudo aptitude update
$ sudo aptitude safe-upgrade
$ sudo aptitude autoclean
Postinstall tweaks
Always take a look at the Ubuntu Wiki: the MacBook page shows how to make all hardware working properly.
Second generation MacBooks (Core 2 Duo) have a newer version of the Atheros Wifi chipset, so you have to install the latest madwifi drivers.
Please note that the current madwifi drivers depend on a proprietary binary, the Atheros HAL, and therefore will taint your kernel.
$ sudo aptitude install build-essential
$ wget http://snapshots.madwifi.org/madwifi-trunk-current.tar.gz
$ tar zxf madwifi-trunk-current.tar.gz
$ cd madwifi<tab>
$ make
$ sudo make install
To automatically load the applesmc kernel module, you have to add it to /etc/modules:
$ echo applesmc |sudo tee -a /etc/modules
Once loaded this module, set a minimum fan speed which may help your MacBook run cooler, adding the following line just before the "exit 0" statement at the end of /etc/init.d/acpid:
echo 3000 >/sys/devices/platform/applesmc.768/fan1_min
Substitute your speed of choice (in RPM) for 3000 if you wish.
Turn the right Apple key into Alt Gr key using the right Win key as third level chooser from System -> Preferences -> Keyboard -> Layout Options -> Third level choosers.
To get the most out of the trackpad, use this InputDevice section in /etc/X11/xorg.conf:
Section "InputDevice"
Identifier "Fully Functional Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "LeftEdge" "150"
Option "RightEdge" "1070"
Option "TopEdge" "100"
Option "BottomEdge" "310"
Option "FingerLow" "25"
Option "FingerHigh" "30"
Option "MaxTapTime" "180"
Option "MaxTapMove" "220"
Option "MaxDoubleTapTime" "180"
Option "HorizEdgeScroll" "0"
Option "VertEdgeScroll" "0"
Option "TapButton1" "0"
Option "TapButton2" "0"
Option "TapButton3" "0"
Option "LockedDrags" "off"
Option "VertScrollDelta" "20"
Option "HorizScrollDelta" "50"
Option "VertTwoFingerScroll" "1"
Option "HorizTwoFingerScroll" "1"
Option "MinSpeed" "1.10"
Option "MaxSpeed" "1.30"
Option "AccelFactor" "0.08"
Option "Emulate3Buttons" "true"
Option "SHMConfig" "on"
# corner buttons
Option "RTCornerButton" "0"
Option "RBCornerButton" "2"
Option "LTCornerButton" "0"
Option "LBCornerButton" "3"
EndSection
Be sure to add a ServerLayout section using
InputDevice "Fully Functional Synaptics Touchpad"
Remember to restart the X server (using CTRL+ALT+Backspace) to load the new settings.
The integrated webcam works out of the box with all programs (Ekiga, for instance) using the V4L2 video plugin.
Extra applications
After enabling "All available applications" from Applications -> Add/Remove... menu it's possible to install some extra applications:
Internet
Opera (opera)
Opera should be the first application to add here, because it "resets" the choices you made after adding Canonical's "partner" repository.
Accessories
7zip (p7zip-full)
ACE (unace)
Bluetooth File Sharing
Cheese (cheese)
Qemu Launcher (qemu-launcher)
RAR (rar)
Games
bomberclone (bomberclone)
Chromium (chromium)
Flobo Puyo (flobopuyo)
Frozen-Bubble (frozen-bubble)
Gweled (gweled)
knetwalk (knetwalk)
Maelstrom (maelstrom)
Mastermind
Neverball (neverball)
Planet Penguin Racer (planetpenguin-racer)
Internet
aMule (amule)
ClusterSSH (clusterssh)
DNS Query Tool (gresolver)
Enigmail extension for Thunderbird/IceDove
Epiphany web Browser (epiphany-browser)
FileZilla (filezilla)
GMail Notify (gmail-notify)
GpsDrive (gpsdrive)
Liferea Feed Reader (liferea)
Mozilla Thunderbird Mail/News (mozilla-thunderbird)
Psi (psi)
Remotedesktop client (grdesktop)
VPN Connection Manager (OpenVPN)
Wengophone (wengophone)
Wireshark (wireshark)
XChat IRC Client (xchat)
Other
Ubuntu Restricted Extras (ubuntu-restricted-extras)
Programming
Bluefish Editor (bluefish)
Eclipse (eclipse)
Sound & Video
Banshee Music Player (banshee)
Grip (grip)
GStreamer Dirac video plugin
GStreamer extra plugins (gstreamer0.10-plugins-ugly)
GStreamer ffmpeg video plugin (gstreamer0.10-ffmpeg)
GStreamer fluendo MPEG2 demuxing plugin
GStreamer plugins for aac, xvid, mpeg2, faad (gstreamer0.10-plugins-bad-multiverse)
GStreamer plugins for mms, wavpack, quicktime, musepack (gstreamer0.10-plugins-bad)
Helix Player (helix-player)
K3b (k3b)
k9copy (k9copy)
last.fm Player (lastfm)
Mplayer Movie Player (mplayer)
Mplayer Plugin for Mozilla (mozilla-mplayer)
Streamtuner (streamtuner)
VLC media Player (vlc)
System Tools
Sun Java 6 Console (sun-java6-jdk)
Setting Java preferences
I want Java-related commands (java, javac and so on) to default to the Sun Java 6 JDK:
$ sudo update-java-alternatives -s java-6-sun
I also installed the Java JDK documentation, downloading jdk-6-doc.zip to /tmp (chowning it to root.root) and installing it with:
$ sudo cp ~/Desktop/jdk-6-doc.zip /tmp/
$ sudo aptitude install sun-java6-doc
$ sudo rm /tmp/jdk-6-doc.zip
Additional packages
I use to install the following additional packages:
#0# # sudo aptitude install \
#0# Email # fetchmail mailx mutt postfix \
#0# Email (universe) # dovecot-imapd freepops-updater-fltk spamassassin spamc \
#0# Utilities (universe) # arj clamav clamav-daemon unzoo
#1# # sudo aptitude install \
#1# Cross Platform # smbfs \
#1# Development # cvs \
#1# Documentation # apache2-doc apt-doc bash-doc bind9-doc debconf-doc doc-linux-html doc-linux-text \
#1# # gnupg-doc grub-doc installation-guide-i386 perl-doc postfix-doc samba-doc \
#1# Editors # openoffice.org-style-tango vim \
#1# GNOME Desktop Environment # epiphany-extensions \
#1# Internationalization And Localization # language-pack-it language-support-it \
#1# Libraries # qca-tls \
#1# Libraries - Development # libncurses5-dev \
#1# Miscellaneous - Text based # chkrootkit kernel-package mysql-server \
#1# Multimedia # vorbis-tools \
#1# Networking # nfs-common nmap ntp openssh-server samba traceroute \
#1# System Administration # subversion-tools \
#1# Utilities # debian-goodies fakeroot powertop \
#1# World Wide Web # firefox-themes-ubuntu libapache2-mod-php5 php5-mysql
#2# # sudo aptitude install \
#2# Miscellaneous - Text Based (restricted) # mysql-doc-5.0 \
#3# # sudo aptitude install \
#3# Base System (universe) # apt-file \
#3# Communication (universe) # tor \
#3# Documentation (universe) # apt-dpkg-ref apt-howto-en asr-manpages debian-history debian-policy \
#3# # festival-doc funny-manpages jargon-text maint-guide quick-reference-en sysadmin-guide \
#3# Games And Amusement (universe) # bsdgames cappuccino fortunes-bofh-excuses planetpenguin-racer-extras supertux typespeed \
#3# GNOME Desktop Environment (universe) # gdm-themes ontv \
#3# Graphics (universe) # cupsys-driver-gimpprint vlc-plugin-esd \
#3# Interpreted Computer Languages (universe) # xmltv \
#3# Libraries (universe) # gstreamer0.10-fluendo-mp3 \
#3# Miscellaneous - Graphical (universe) # compizconfig-settings-manager industrialtango-theme tango-icon-theme-extras \
#3# Miscellaneous - Text Based (universe) # gpsd-clients module-assistant \
#3# Multimedia (universe) # audacity festvox-italp16k festvox-itapc16k id3tool mpg321 soundconverter sox \
#3# Networking (universe) # aircrack-ng airsnort bitchx-ssl debmirror kismet madwifi-tools netdiscover p0f tshark \
#3# System Administration (universe) # apt-show-versions rkhunter \
#3# Utilities (universe) # gphoto2 hddtemp mc sshfs vlock \
#3# Word Processing (universe) # foomatic-db-gimp-print xmlstarlet \
#3# World Wide Web (universe) # privoxy smarty smarty-gettext
#4# # sudo aptitude install \
#4# Development (multiverse) # netbeans5.5 netbeans5.5-doc \
#4# Documentation (multiverse) # doc-linux-nonfree-html doc-linux-nonfree-text php-doc rutebook \
#4# Multimedia (multiverse) # lame
#5# # sudo aptitude install \
#5# Medibuntu (free) # libdvdcss2 libk3b2-mp3 \
#5# Medibuntu (non-free) # googleearth skype w32codecs
Multiple networking environments
I use my laptop in several places (home, customers' offices, friends' homes), and I manage these network environments easily with netenv.
Install it and use the script provided as a Debian example (or this one, which requires gawk and manages multiple network interfaces, wireless settings and hosts in a friendly manner).
I expect to build a Debian/Ubuntu package also with the tweaks I made to /sbin/netenv to make netenv run properly on Ubuntu.
$ sudo aptitude install gawk netenv
$ sudo install -m 755 ~bibe/public_html/gutsy/netenv_setup /etc/netenv/
$ sudo install -m 755 ~bibe/public_html/gutsy/sbin_netenv /sbin/netenv
$ echo NETENV_SCRIPT=/etc/netenv/netenv_setup |sudo tee -a /etc/netenv/netenv.conf
I also add some altoptions directives in /boot/grub/menu.lst (leave these lines "commented", or you will lose them when updating grub) for commonly used network environments.
Grub configuration gets updated automatically at every linux-image (re)installation: to do it manually, simply run
$ sudo update-grub
Alternatives
Debian's way to manage multiple programs for the same task (i.e., editors) is the use of alternatives, which are symlinks provided in /etc/alternatives/.
For instance, I set vim (instead of nano) as the system's default editor:
$ sudo update-alternatives --config editor [ select /usr/bin/vim.basic ]
Kismet Log Viewer
An interesting utility for viewing Kismet output as HTML pages is Kismet Log Viewer, available here.
To install it, download the latest binary (version 0.9.7) and
$ cd /usr/src
$ tar zxf /path/to/kismet-log-viewer-0.9.7.tar.gz
$ cd kismet-log-viewer-0.9.7
$ install -o <kismet_suid_user> -m 700 *.pl <kismet_logs_path>
$ install -o <kismet_suid_user> -m 644 logo.png <kismet_logs_path>
Reboot
Now the system is fully configured: reboot and issue a
$ dmesg |less
to verify that there are no errors and/or problems during the boot process.
TODO list
I still have to test firewire and bluetooth with the appropriate hardware.
I hope you will find some of these information useful, and if you have any suggestion for helping me to get everything to work, please email me at
bibe AT atworkonline DOT it