I thought it might be fun to put my Late 2006 iMac (iMac6,1) to some use and install the latest version of Ubuntu on it: 18.04 Bionic Beaver. This older model iMac comes with the Core2Duo chipset, which is 64-bit. Unfortunately the Apple EFI on it only supports 32-bit, and so you will likely be unable to use normal install ISOs. You can avoid this problem by skipping EFI altogether and going into normal BIOS booting. Matt Gadient wrote a very useful blog post describing the problem and a few different fixes. I ended up having to burn an actual DVD for the install to work; I could not get either native EFI solution to work.

After installing Ubuntu, there were two things not working out-of-the-box: the AirPort card and the nVidia drivers.

  1. The AirPort card was easy enough to fix and this is well-documented. There is an error in the dmesg output that directs you to the kernel wiki page, but I did not find that particularly useful. As usual, Stack Exchange has a great, thorough answer. If you have network connectivity already via an Ethernet cable, just go ahead and type sudo apt install firmware-b43-installer. The post outlines instructions if you need to do it offline as well. Unplug your Ethernet, reboot, and you should now be able to see your available WiFi networks.

  2. The bigger challege was getting the nVidia driver to work. According to Ubuntu bug #1763648, Canonical will no longer be including support for many older GeForce cards, including the 7300 GT. Thankfully, Seth Forshee has already created a patch! I’m not sure the correct way to patch an Ubuntu PPA, so I manually applied the patches to nVidia’s installer file. There’s actually two patches you’ll need to apply: buildfix_kernel_4.14.patch and buildfix_kernel_4.15.patch

However, before we get to patching and installing the official nVidia binary drivers, we need to disable nouveau, the open source version. To do that, enter these commands:

$ sudo su -
# cat << END > /etc/modprobe.d/disable-nouveau.conf
blacklist nouveau
blacklist vga16fb
blacklist rivafb
blacklist nvidiafb
blacklist rivatv
blacklist amd76_edac
options nouveau modeset=0
# update-initramfs -u
# reboot

After the system finishes rebooting, we need to install the necessary build tools:

$ sudo apt install gcc make build-essential gcc-multilib dkms mesa-utils

Now we’re ready for patching. Here is the combined patch file (the aforereferenced patches are “meta” patches, as they’re patches to the package and not the software itself, which is sort of like a Russian nesting doll of software changes). This combined patch can be applied to the directory created using sh -x.

Click here to download nvidia-304.137-bionic-18.04.patch.

Once you have the patch saved into your home directory, you can apply it and begin the installation using these commands:

$ ./ -x
$ cd ./NVIDIA-Linux-x86_64-304.137
$ patch -p1 < ~/nvidia-304.137-bionic-18.04.patch
$ sudo ./nvidia-installer

You can ignore the first warning about the preinstall failing, as it is merely a check to make sure you want to do this. Go ahead and view less /usr/lib/nvidia/pre-install if you don’t believe me! The build should complete and you should let it update your config files. Reboot again and then verify you’re using the nVidia driver:

$ lshw -c video 2>&1 | grep driver

You want to make sure you see:

       configuration: driver=nvidia latency=0

And not:

       configuration: driver=nouveau latency=0