Mac OS Installation Guide for Linux Users

From korrekt.org

As of August 2010, this page is mostly complete. It will be updated as I find more solutions.

These are my notes on how to set up a Mac for reaching a productive state. The guide is motivated by Rob Shearer's earlier guide for setting up a Mac but turned out to take a rather different shape. This guide is written July 2010 when installing a MacBook Pro running Snow Leopard (MAC OS X 10.6).

My perspective is that of a Linux user who is used to the UI behaviour and tools found on typical Linux desktops. I also address various questions of data migration from Linux to Mac. Beyond this basic setup, my main application requirements are (1) web use and online communication, (2) scientific writing with LaTeX, and (3) development in various programming languages.

If you are new to Mac, you may want to first read this useful guide to get a basic idea of how Mac's window manager and special keys work. Much of the confusion relating to keys and different window switching can be undone; read on.

Comments and feedback for this article can be sent to me via email: markus at this domain.

Basic system settings

  • Install Mac OS from DVD. Boot your new OS. If you come from Linux, you probably want to pick a case-sensitive filesystem which is not the default option on my Snow Leopard installation CD.
  • Enable fundamental security settings using the System Preferences. Require login with password, activate firewall.
  • Use System Preferences -> Software Update for updating the basic system software to the latest patches.
  • Shorten your machine name: System Preferences -> Sharing
  • Set root password and shell: open Terminal and type
sudo su    #to become root
passwd     #to set your password
  • Disable the embarrassing Mac boot sound by installing StartupSound.prefPane from Arcana.
  • Configure Finder file manager to show all files (including system files and directories that are otherwise hidden) by running
defaults write com.apple.Finder AppleShowAllFiles YES
on the command line. Finder drops its configuration files (which you can now see) everywhere, and you may prefer to use a file browser like muCommander that does not do this. One can only switch off Finder's unwanted write activity for external drives, but this is certainly worth doing (you know what I mean if you ever gave a USB stick to a Mac user!):
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
I also used finder's own preference menu to enable the display of file extensions. The closest thing to an address bar I could find is the Path Bar that can be enabled via Finder's View menu. There is also a path button that can be added to the toolbar, but no real address bar seems to be offered. Again, I am more happy with muCommander now.
  • Get IBM keyboards running with correct layouts, I simply installed the respective layouts from Ukelele. It is not necessary to install the software: you can simply copy relevant .keylayout and .icns files from Ukelele's Logitech Keyboard Layouts folder to /Library/Keyboard Layouts or to ~/Library/Keyboard Layouts (local user only). After that, the new layouts can be selected in System Preferences -> Language & Text -> Input Sources.
I first tried the Logitech Control Center (v3.3.0), but it broke for me after migrating to a new 13" MacBook Pro. Searching the web for fixes, I learned that this is very unstable software that is not recommended unless you desperately need support for very special Logitech features (things like the special buttons on the keyboard can also be configured via Ukelele and do useful things by default).
  • Apple's default interpretation of Home and End can be extremely disturbing for users of other operating systems, especially power users who do a lot of quick typing. To fix this problem, I followed instructions found online, though the tool KeyFixer may even be a simpler solution. This fixes the behaviour on most Mac applications. To get Firefox working as well, the KeyFixer extension needs to be installed. Many third-party applications have independent settings for this (or none at all).
  • To make the middle click of the mouse usable in applications (e.g. for new tab in Firefox), disable the Dashboard shortcut in the System Preferences. This is the best I found so far for the middle click; right now there seems to be no way for getting the "select to copy, middle click to paste" feature, especially not with two distinct buffers that allow you to copy two texts at once by using different copy/paste methods as in X11. But disabling the dashboard shortcut alone already enables mouse copy and paste in Terminal.app.
  • I cannot get used to switching between applications and between windows of one application separately. It simply seems to take more thought and time than having a single way of switching windows. Luckily, Mac OS has this single way: by default it is Applekey+F4. I used System Preferences -> Keyboard -> Keyboard Shortcuts -> Keyboard and Text Input to change the shortcut for "Move focus to active or next window" to Alt+Tab. This solves two problems at once: you get the switching behaviour you are used to, and you do not have to learn new key combinations for switching (the Mac switching keys are still intact). The Mac window switching still has some serious limitations, e.g. not doing smart re-ordering of least recently used windows, and failing to work in some cases. But I have not found a better solution.
  • Get the good old Linux "Virtual Desktops," now called Spaces in Snow Leopard, using the System Preferences. Switching between spaces can be configured to work with Ctrl+Number which is almost as good as X11's Ctrl+Fi. Using the active window switching as above, you only cycle through windows of the active space, which is just what I prefer (interestingly, this is different to the application switcher Applekey+Tab which is still global to all spaces). Spaces are not implemented very well yet, e.g. the slow animation when switching them cannot be turned off. Moreover, the Dock is always global, so that you are carried to random spaces when clicking an application that has windows in multiple spaces.
  • Some control over the Mac's sleep/hibernation behaviour can be regained using the pmset command line tool (see its man page for details). For example, I had a machine with broken battery, and thus set the standard suspend mode to not use the RAM (i.e. to suspend to disk/hibernate).
  • To prevent the Mac from automatically sleeping when closing the lid (which is annoying if you want to put it away while playing music or doing background work), I installed the free InsomniaX tool. Note that Macs may not be suitable for closed lid operation during heavy use due to their insufficient cooling capabilities.
  • Make the Dock less ugly by running
defaults write com.apple.dock no-glass -boolean YES
This yields a flat version of Dock (takes effect after restart). You may or may not want to set the Dock to auto-hide using the System Preferences.
  • Disable the dashboard. I do not need this thing, so I switched it off:
defaults write com.apple.dashboard mcx-disabled -boolean YES

This requires killall Dock or a reboot to take effect.

Open issues:

  • How to get a good desktop ("spaces") switcher/editor similar to an always visible, small version of what you get with F8?
  • How to configure other third-party mice without buying extra software? One would think that something that basic should be possible somehow without purchasing more products.

Basic connectivity

  • Get Firefox
    • Use the KeyFixer extension for restoring the common behaviour of Home and End keys.
    • The Logitech Control Center has been used to make sure the third mouse button works for opening tabs as on other operating systems (see above).
    • By default, Firefox Mac stores all files opened from the browser on the Desktop (instead of using a temporary directory), and does not ever delete them. The directory location can not be modified in Firefox (it used to be based on Safari's download directory, but new Safari versions use another place for storing this). But you can make Firefox delete its droppings on exit: go to the URL about:config, click right, create a new Boolean entry called browser.helperApps.deleteTempFileOnExit and set it to true.
    • Import your old bookmarks. This can be done via the Organize Bookmarks menu in Firefox, but you cannot select Linux bookmarks file there since it is in a hidden directory. Copy it to a Mac-accessible location at first:
cd <old-linux-home>/.mozilla/firefox/<cryptic-profile-name>/
cp bookmarks.html ~/linuxbookmarks.html
  • Get Skype
  • Configure Mac's email client to at least show (IMAP) your main inboxes (needed e.g. for doing online registrations when installing software)
  • Install VPN client if needed
  • Mac's AirPort user interface only provides the most basic features. It does not even show the channels of visible networks (kind of stupid if you want to configure a WLAN router in your home to not share channels with other networks). To get channel information, you can run
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/
Current/Resources/airport -s
To make the airport command available without the longish path, set a symbolic link with
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/
Versions/Current/Resources/airport /usr/local/bin/
The command also has some other potentially useful options; run without arguments for a description.

Source code handling (installation and development)

Even if you do not develop software, the installation of some Linux tools on Mac requires basic development tools.

  • For installing ported Linux tools via MacPorts or Fink, you need to have a C++ compiler and various basic tools. I got and installed the Apple Developer Xcode Tools from the Apple Developer Connection for this purpose (Apple has annoying and non-applicable registration questions for you if you merely want to use these tools for installing software from source, but the package contains all that you need).
  • SVN seemed to be pre-installed on my machine, or it came with the Xcode Tools.
  • Among the free-of-charge tools, I found TextWrangler to be closest to what I expect a text editor to be. It features dynamic word wrap (a topic where Eclipse fails miserably since years) and allows Home/End key behaviour to be configured via the preference menu.
  • I installed Eclipse and its C++ extension CDT.
    • To configure Home and End key behaviour for Eclipse, go to Preferences -> General -> Keys and use the search field to find and modify the following bindings to work with Home and End: Line Start, Select Line Start, Line End, Select Line End. In each case, a conflict with the Mac meaning of Home and End will occur (lower right box) that can be easily resolved by clicking on the conflicting actions and changing their shortcuts to use Ctrl+Home and Ctrl+End (the common behaviour).
  • For web development, I installed Apache2, MySQL, and PHP from MacPorts (the PHP 3.5.1 shipped with Snow Leopard has a major bug, and I preferred to use packages from a single source). I essentially followed the existing guides for setting up Apache and PHP and installing MySQL.

Getting a more productive terminal

Linux users may find the Mac command line to be not very satisfactory. I have complied some adjustments to make it more useful in the article Toward a More Powerful Terminal on MAC OS.

Transferring Emails from KMail

Importing emails from KMail's proprietary maildir format into other clients is not easy, especially if the computer that used to run KMail has crashed and no running version of the tool is accessible anymore. I have created a separate article on how import KMail emails into essentially any other client.

Transferring passwords from a Linux password store

It is common to use tools for managing passwords, and there are plenty of them on all platforms. Any proper password manager stores its data in an encrypted, and typically proprietary format on disk, making it hard to migrate data.

Mac has its own password manager Keychain but it cannot import data from other applications, and (more problematic) it cannot export data in any format. Apple suggests to make backups by copying the encrypted files from disk. So if you want to lock yourself into using Mac for all future, then this is the choice for you. Also note that the tool does not give you any option for printing your passwords (the safest way to backup this type of data, given that you print on a local/home printer and put the output in a safe place).

For more flexibility, I selected the multi-platform tool KeePassX. It runs on Linux, Mac, and Windows, and the fact that it is Open Source greatly increases my trust in its security. It also has import features for KWallet data (KDE's password manager) and for older pwmanager data. I used pwmanager before, but the files could not be ported. Yet, pwmanager can import and export data from further formats, notably KWallet and Kpasman/Gpasman. The easiest way to get a running instance of pwmanager for this purpose is to obtain a Kubuntu Live CD for Karmic Koala or earlier (later versions do no longer have it in their repositories). You can install further software even on a Live CD, and you can copy the converted files to a USB device. This solved the problem or me, although I had to manually retype the comment and username fields of each account since they were lost in pwmanager's KWallet export. I hope that my choice of KeePassX will save me from such work in future migrations.

LaTeX

  • I prefer the small BasicTex distribution as advertised at tug.org. Faster install, immediate availability of most features one needs.
  • It is easy to install more LaTeX packages and fonts using the Tex Live Manager as included in the BasicTex package. What I did (on the command line, as root) was:
tlmgr update --self   #update the Tex Live Manager
tlmgr update --all    #update all distribution packages

Then you can install more packages as needed:

tlmgr list | grep search-string-for-package-list
tlmgr install package-to-install

Then extra packages I installed so far are:

txfonts rsfs courier helvetic stmaryrd dinbrief eepic
algorithm2e relsize framed type1cm footmisc xypic symbol
soul tocbibind draftcopy ifsym bibtopic subfigure zapfding
  • Install ps2pdf. The pipeline "latex -> dvips -> ps2pdf" preserves hyperlinks and PDF table of contents on Linux, but the corresponding "latex -> dvips -> pstopdf" on Mac discards both. Switching to pdflatex cannot generally solve this problem, since documents that use eps graphics would require them to first be (manually) converted into a format that pdflatex supports. Using MacPorts, you can install ps2pdf by
port install ghostscript +no_x11

Open issues:

  • What to use as a good LaTeX editor if you are not a Vim or Emacs person?

Media

I found iTunes rather disappointing as a music player. It does support only a very small set of audio formats and still seems to be very heavy-weight. I also do not like its interface (starting with details such as displaying a play time of "1.2 hours"!). Most work there seems to have gone into Apple's shop integration, which cannot be disabled or hidden.

  • I quickly found Cog to be the audio player of my choice. Light-weigt and simple, yet with better support for audio formats and their metadata than iTunes. It even allows you to simply open a file in order to play it. Whew! These days, iTunes seems to be more about media management and purchase than about playback. But I have a home media server (used with Logitech's SqueezeBox) for doing the real management, and on my portable laptop I just have (changing) files, no "media library". Being simply file-based, Cog also has absolutely no application lock-in, so one can always go for another tool later.
  • If I would like the concept of iTunes, I would probably install Songbird which seems to have similar goals but is built by a larger developer and user community rather than by Apple alone. For a start, it supports more audio formats and more diverse online shopping options. For another option, it might also be interesting to look at Play (but I didn't).
  • For ripping my CDs to any audio format of my choice, I installed Max.
  • To play OGG and FLAC files on Apple tools (just in case), I installed the Xiph Quicktime components. Note that this is just a quick patch to enable some basic replay with iTunes. Unfortunately, Apple's tool is not engineered well for supporting such extensions and there are restrictions on what iTunes will be able to do with the new audio formats.

Other programs

I installed the following further tools:

  • wget: yes, Mac OS lacks this basic utility. Using MacPortds (see above), you can type:
sudo port install wget
  • muCommander for avoiding Finder and its unwanted write operations all over my disk. Another advantage is that muCommander gives you an editable path bar.
  • Inkscape which is simply the best vector graphics editor. The fact that it runs on all major operating systems makes it great for co-operating on graphics, e.g. when making figures for a paper with co-authors who use different platforms. But it is also wonderful when used on a single platform only.
  • Burn for being able to burn optical disks.
  • I use Thunderbird for emails.
    • When opening attachments in Thunderbird, a copy of the files is created on your Desktop that is never deleted, thus cluttering your Desktop over time. To make Thunderbird delete its droppings on exit, go to Preferences -> General -> Config Editor ..., click right, create a new Boolean entry called browser.helperApps.deleteTempFileOnExit and set it to true.
    • Again, installing Keyfixer helped me a lot.
  • Skim, a good PDF viewer for reading and annotating documents. By default, Skim does not follow file changes (which you will want when making PDFs with LaTeX): go to Preferences -> Synch to change this.
  • Calc is a tiny calculator that let's you type in your calculation and that shows a history of the calculations. Two major advantages over Appple's Calculator.app, I think.
  • MacFuse and Fuse-ext2. I installed these tools to be able to access Linux ext2/ext3 partitions. This is partly for data recovery, and partly since I found this to be the best file system that is reasonably readable from any operating system but preserves file names and user rights (as opposed to FAT32). So I use this as a file format for my backup drives now.

Feedback and comments

Comments and feedback for this article can be sent to me via email: markus at this domain.