Discussion of this wiki can be found here


This guide ceased to be mantained by lunarts(me) on 15/03/13 as I cannot create guides for a hardware I no longer have. Someone must assume the role or this guide will quickly become outdated.



" Quantal came to imac, with a friendlier attitude "

  • First of all, let me make clear which this guide is only to the imac model mentioned above, the farther your hardware is from the above, the more it is probably this guide will not help you, or may even cause you problems. I'm almost sure what I have experienced regarding the above model and (X/L)ubuntu 12.10(Quantal) applies to all computers with this specific model(21,5 inches, radeon hd 6770m, quad core i5), but you will be following this guide at your own risk even then. (X/L)Ubuntu 12.10 for mac behaves better than its predecessor, but some important things still must be solved to use it.


The current known issues, which may or may not be fixed in the near(or far) future are below, please note the differences from the original 12.04 observation to the observation at its side and consider them on the instructions which comes next(avoid unneeded steps):

Cannot boot ubuntu without rEFInd or similar(only for 12.04, actually avoid rEFInd at 12.10)

Noisy screen(most noticeable against dark-grey backgrounds): https://bugs.launchpad.net/ubuntu/+source/fglrx-installer/+bug/1020374(Must retest on 12.10)

Cannot properly use the mac default EFI system without running Super Grub 2 Disk once to enter the ubuntu OS you installed(must retest on 12.10).

Overall bad apple keyboard and mouse recognition(better on xubuntu maybe).

For Brazilian language you will need to do additional configuration. https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/1012695

For Xubuntu 12.10, additional configuration is needed for keyboard.

The 12.04 Ubuntu open source driver for radeon hd 6770m is hugely slow, mainly for games and other graphic intensive tasks; no ubuntu packaged AMD driver will work out of the box due to video memory recognition issues(https://bugs.launchpad.net/ubuntu/+source/fglrx-installer/+bug/1004546).(default driver works better on 12.10, but not enough. ubuntu packaged drivers work on 12.10, but with a detail discussed later)

You will need the usb keyboard to choose ubuntu at rEFInd, otherwise you will have to pair again your keyboard as described at mac manual at OS X everytime you want to do the above. You will also need a usb mouse or wacom tablet.(Seems to still apply on 12.10 ubuntu)

Everytime you switch which OS you load, that OS will take over the keyboard and mouse, and you will have to setup them again at the other OS to get it to work there, which in turn will make the other OS lose keyboard and mouse input again until pairing is done again there. In resume, currently you will never get both OS's to have simultaneous wireless keyboard and mouse input.(must retest on 12.10)

Your headphones will not work, just built-in speaker(https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1003039). Workaround already avaible.(workaround still needed on 12.10)

Needs patience to setup keyboard and mouse at ubuntu with the default bluetooth manager(bluez, https://bugs.launchpad.net/ubuntu/+source/bluez/+bug/1001825); maybe installing blueman speeds things a bit, thought bluez seems more reliable after device detection(may be just me).(seems still true on 12.10)

IF THINGS GET NASTY(ubuntu 12.04 specific)

  • If you got a black screen after the AMD driver install and nopat does not work(in ubuntu 12.04 case), at grub 2 boot loader

enter your current linux kernel image under recovery mode > ¨drop to root terminal¨ > type and confirm:

  • mount -rw -o remount /
    This will allow you to make changes to your failed ubuntu install, then type and confirm:
    This may allow you to have a working ubuntu(if not temporary) at the next ubuntu boot; sometimes you also may need to type ¨amdconfig –initial -f¨ before the reboot command above. If that does not work. Type and confirm the following(the first line only if you installed the no distribution specific AMD site driver):
    sudo sh /usr/share/ati/fglrx-uninstall.sh
            sudo apt-get remove --purge fglrx fglrx_* fglrx-amdcccle* fglrx-dev*
    The first line above only if you installed the amd site radeon driver without generating ubuntu packages.
    sudo apt-get remove --purge xserver-xorg-video-ati xserver-xorg-video-radeon
            sudo apt-get install xserver-xorg-video-ati
            sudo apt-get install --reinstall libgl1-mesa-glx libgl1-mesa-dri xserver-xorg-core
            sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
            sudo rm -rf /etc/ati
    This will revert ubuntu to the default open source non AMD driver, which usually works.

    If the above does not work use the ubuntu live cd>test ubuntu, start terminal(ctrl+alt+T) and do(X is the number of your root / partition):

    sudo mount /dev/sdaX /mnt
            sudo chroot /mnt
    The above will give you acess to the lost ubuntu install; from there do the video driver full cleanup and revert to open source said above.

    If everything else fails, use the live cd > install ubuntu, and format and reuse the root partition as root, also reuse but DO NOT FORMAT the home partition. This last attempt is almost guaranteed to work.


  • Before anything download the mac only 64bits desired ubuntu image and burn it to a media (cd, dvd). Ubuntu 12.10 images can be found in the 12.10 release page, and here's a direct link to the ISO. It is not recommended, but Ubuntu 12.04 images can be found in the 12.04 release page and here's a direct link to the ISO. For Xubuntu the 64-bits PC image will suffice(NO 32-bits one), For Lubuntu, grab the mac only 64 bits image(not the powerPC one). Go to the OS X disk utility and ask it to split the hd single partition into two equally sized partitions, let the new partition be 'Free Space'.

    Go grab yourself a cheap usb keyboard and mouse(the more popular the device brand is the merrier), you WILL need them, Ubuntu keyboard and mouse support is lacking currently. Then Download and burn to a disk Super Grub 2(http://www.supergrubdisk.org/category/download/supergrub2diskdownload/), so you can actually properly boot your ubuntu later using the imac system default EFI stuff; also at your OS X system, download rEFInd(http://sourceforge.net/projects/refind/files/latest/download) and install, which will let you choose between ubuntu and os x at mac startup(rEFInd is unnecessary for 12.10 ubuntu, it may actually bug your ubuntu session). With the ubuntu media mentioned before burn and ready, restart your imac. After the startup sound keep the keyboard alt key pressed until a menu appears, choose the cd wrongly labeled 'windows', if it does not show up, wait a bit until it do. Do not try to let the imac automatically detect the disc, because or it will not, or it will actually refuse it. If you apple mouse do not work at first at the test/install screen, click it a bit and it will, enable the onscreen keyboard(probably the apple keyboard will not work) at the little man symbol at the right-top area(apple keyboard will not work) or use the usb keyboard(easier). Choose your language, mark the third-party stuff checkbox, and DO NOT mark for ubuntu to update already(to avoid wasting your internet limit if any, just do so when the video driver is truly working later), WHEN ubuntu ask if you want to overwrite your OS X, place it side by side or manual, go manual. Use that space you previously freed with diskutility at OS X as 10gb or more as / with ext4, 2mb for grub bios partition, 4gb for the swap, and all the rest to a /home with ext4 too(do not forget to create this /home partition); select for boot loader install the partition which you configured as root /(check the labels which the partition manager show you above), do not install boot loader at the hd root. Proceed until install is complete and click reboot, use the usb keyboard to finish the boot when requested. In case you wonder, splitting ubuntu between /home and / is usefull in case you need to reinstall ubuntu, you will have to do so only at /, /home will be kept intact, with all your files safe.

    Ensure your wireless keyboard is working at startup(Super Grub 2 Disk cannot recognize usb keyboard), otherwise pair it at OS X like the mac manual says(system conf>keyboard>bluetooth conf, shutdown keyboard(press the keyboard power button until it shut down, dont just touch it) and turn it on again there), then press Alt at startup, but with the super grub 2 disk at the your cd reader instead, select somethind like 'detect even if the MBR is overwritten', select the only entry which will appear and boot ubuntu normaly, but just due to super grub disk 2. Try the 'detect grub.cfg' if the last entry don't work.

    Under Ubuntu system configuration > keyboard layout, use English(Macintosh) for the apple keyboard keys to work properly; you can do this later too. If you are Brazilian, type this at terminal:

    setxkbmap us -variant intl

    You will now have support for Brazilian accents(http://digitalareablog.wordpress.com/2011/12/22/configuracao-acentuacao-no-linux-ubuntu-11-10-virtualizado-no-macbook/). Thought you will need to do so every time the computer sleeps, restarts or is shutdown. This also outputs wrong quotes characters, useless and dangerous in programming(must file bug report).

For (L)Xubuntu, besides selecting English(Macintosh) for your keyboard, you must do:

  • leafpad ~/.Xmodmap

Then add to the file and save:

keycode 37 = Super_L NoSymbol Super_L
keycode 133 = Control_L NoSymbol Control_L
keycode 134 = Control_L NoSymbol Control_L
clear Mod4
clear Control
add Control = Control_L
add Mod4 = Super_L
add Mod4 = Super_R

Exit and reenter you session and the command keys will be mapped to ctrl, and ctrl to the command keys. That is so because for xubuntu the command keys are the 'win' keys, and you are left with only a single ctrl at a bad ergonomical position, linux uses more ctrl than 'win' keys, so we had to fix that. In case it do not work, type at the Xubuntu terminal:

xmodmap ~/.Xmodmap
  • For Video, if you use 12.04, go to Ubuntu system configurations > proprietary drivers and install the “ATI/AMD fglrx proprietary driver”(do not install the post updates one for 12.04), there is a detail thought only for 12.04 we will see later. For 12.10, DO NOT install throught the ubuntu gui, instead pop up terminal, and simply type there:

    sudo apt-get install linux-source linux-headers-generic fglrx-updates

With 12.10, after that everything will work right away after boot.

  • Since you are at terminal, update the system known packages with: sudo apt-get update

    After that, if you use 12.04 do the procedure mentioned here from step 19 to 28: http://www.rodsbooks.com/ubuntu-efi/index.html , otherwise if you use 12.10, no rEFInd is necessary anymore, in fact it can bug your linux session brightness keys support, you do will have to install grub-efi anyway(steps 19 to 28):

If plain sudo grub-install do not work, do:

sdXY is the / partition of your ubuntu(ex: mine was sda7), sdX is the root of the ubuntu hd(ex: sda at my last example)

  • sudo mount /dev/sdXY /mnt
     sudo grub-install --root-directory=/mnt/ /dev/sdX

From ubuntu 12.04 to 12.10, it seems grub-efi now demands an additional argument after grub-install keywords.

  • If you use 12.04, go to OS X and edit rEFInd.conf to always select by default OS X, the path to the file is macintosh hd>EFI>rEFInd>refind.conf. You will need to command+i > change permission((be sure to remember how the permissions are now)) of the refind folder and refind.conf to be able to edit it with a text editor; You will know what line is responsible for rEFInd entry as the the file is well commented(at the comment it will mention which you can put a number between 1 and 9), change the default entry to 2 and save. Don't forget to command+i the two(refind folder and refind.conf) again and restore the permissions as they were(probably read only to everyone eles, read-write to system group). It is very probable ubuntu will boot with a black/blank screen after boot if you installed the video card proprietary driver AND use ubuntu 12.04(if done right, 12.10 will never had this issue), if that happens, leave your ubuntu entry at grub bootloader highlighted, and press e; at the line with “quite splash”, add to its end “nopat”(without quotes of course) and press F10; you will have to do that at every ubuntu startup, if it works more than twice you can change your grub file so it always include that parameter for you, if só:

    sudo gedit /etc/default/grub
    Add “nopat” to “quiet splash”, turning it in “quiet splash nopat”, save the file and exit. Then update the grub configuration by running:
    sudo update-grub

nopat is not needed for ubuntu 12.10.

  • For your headphones to work, go to terminal then:
    sudo gedit /etc/modprobe.d/alsa-base.conf
    Add to the last line of this document, the following, save and reboot:
    options snd-hda-intel model=imac27_122

For Lubuntu that will be it, unless you need skype, in that case, for lubuntu do:

sudo apt-get install pulseaudio pavucontrol pavumeter

Reboot, unless you do the above skype will not have mic support, as skype depends on pulseaudio or alsa. Do after reboot:


Ensure at Settings 'Turks/Whistler HDMI Audio' is disabled; if necessary reboot (if you needed to change it).

  • For Xubuntu, if your keyboard volume keys are not affecting the system volume on Xubuntu(maybe on ubuntu also), go to the System Settings manager > settings setup > xfce4-mixer; the first property(active-card) probably is set to something with your video card audio port name on it(in imac case, radeon). Change that to PlaybackBuiltinAudioAnalogStereoPulseAudioMixer and reboot, if necessary, at the sound settings(desktop top bar audio shortcut) switch from 'HDMI radeon' to Disabled at Volume control settings tab.

    • Reboot. The ubuntu screen will become fully bright with 12.04, if you value your eyes you will need to do this at terminal(if 0.7 is still too bright, try 0.6 or lesser):
      xrandr --output LVDS --brightness 0.7

If you have 12.10, rEFInd is not necessary, and as such, you will have no brightness problems.

  • Your (X/L)ubuntu should now be working in the limits currently possible for an imac 2011, now you can update your system software, language support and install your favorite programs.


  • You may want to test newer linux kernels to see if there are any improvements into how ubuntu behaves at a mac computer; I will not teach you how to do that, but I will teach you how to get rid of such kernels if your experiments start to mess everything up, more specifically AMD video driver experiments(http://www.liberiangeek.net/2011/11/remove-old-kernels-in-ubuntu-11-10-oneiric-ocelot/). Check your current working kernel with:

    uname -r
    Check all the current installed kernels:
    dpkg --info | grep linux-image 

    Remove the desired kernels(replace target_linux_image with the kernel image name, just ctrl+shift+c then ctrl+shift+v), do not remove your current kernel image(remember the above uname -r):

    sudo apt-get purge target_linux_image 
    Update the Grub 2 boot loader(that black screen before ubuntu with many entries, one of them marked as grey)
    sudo update-grub2


- Do not install Deja Dup, use Back in Time instead.

- Energy manager will always complain your mouse and keyboard battery are empty(even fully charged), do not shut the application down, otherwise you will not have screen brightness control anymore.

- If you start Xubuntu and it has messed graphics, do not restart, shut down your computer instead and turn it on again. I once heard imacs restart is 'softer' than on windows machines, so to truly restart things if required you need to shut down. It usually seems to work for me better than restarting for Xubuntu Garbaged graphics bug.

- Go to the system configuration manager > Settings Editor > xfwm4 > easy_click . Set it from alt to none. That will avoid alt moving your window when using blender and gimp(if you use them). For Lubuntu, in terminal do:

leafpad ~/.config/openbox/lubuntu-rc.xml

With leafpad find locate any entry with the words 'A-Up' and 'A-Down'; change them to 'A-S-Up' and 'A-S-Down'; if by pressing alt key you mouse turns into a hand above a window, you forgot to to add 'S' somewhere.

If you find your keyboard layout being reseted after each boot on Lubuntu, go to terminal and;

sudo dpkg-reconfigure keyboard-configuration

Answer the questions and reboot. This is a temporary fix for an Ubinquity issue.

If you have a Wacom tablet, at (X)Lubuntu, first check what is the name of your tablet touch entry with:

xsetwacom --list devices

Then at system configurations > session applications create an entry which calls the following command(replace "Wacom Bamboo 2FG 6x8 Finger touch" with your entry above):

xsetwacom --set "Wacom Bamboo 2FG 6x8 Finger touch" touch off

Now only your pen will work, you can do different, and disable the pen if you want and keep touch on.

If you accidentlly delete your shutdown delete button(or any important menu):

cd ~/.config/lxpanel/Lubuntu/panels/
rm panel
lxpanelctl restart

You just deleted your panel settings and restarted it, since there is no custom settings anymore, it will use the system default panel.

In Lubuntu, if you want the clock to show day and month besides the hour and minute, add this to the clock settings:

%d %b %R

If you have an ipod nano, and want to pass .ogg files with gtkpod to it, but it does not work; check gtkpod ogg plugin first, then do the below at terminal:

sudo apt-get install id3v2 lame vorbis-tools

Install Libavcodec-extra-53(in lubuntu, other places call it extra-51) if you need to convert videos with avconv from one video/audio format to another.

You do not need a software to fully erase your dvd, just install growisofs, put your dvd in and:

growisofs -Z /dev/sr0=/dev/zero


  • Hope this guide helps you, as I discovered a lot of the things above the hard way; if you discover a better way of working around the current ubuntu 12.04 issues on an imac 2011, let me know; it is good to test yourself if the information provided is the indeed the best one(thought doing so is quite dangerous, I 'stained' for quite some time my imac screen pixels recently). (X)Ubuntu 12.10 for mac is much better than 12.04 was, althought it still has important blocking bugs to begginners, thought the system do not ceases to be interesting due to things mentioned at the guide introduction; I guess Ubuntu team actually tries to make a working mac ubuntu, as it gets better with time at mac. Also, if you find a problem with ubuntu on an imac, even if it is tiny, let people know at launchpad, do not wait for others to submit the bug report for you; otherwise the problem will take longer to be solved, or will not be solved at all. Help at the bug links I presented at the 'Know Issues' section of the guide, just by saying there these bugs affects you(click the "it affects me too" button at the top there) or by providing additional information.




The pdf version can be found here


ubuntuprecisequantalon2011imac (last edited 2013-04-05 20:07:36 by lunartsbr-gmail)