Installing Ubuntu 22.04 on 2009 iMac

tjtharrison
4 min readOct 13, 2024

--

This is my first time writing an article in a while, and this time it’s something completely different from my usual Security / DevSecOps articles.. Though I do have quite a few Vault / Kubernetes articles queued up that I plan to finish soon.

I was recently given a late 2009 iMac from a relative, due to it’s age it would not run a supported version of MacOS so.. Being the Ubuntu fan I am, I thought I would install Ubuntu on it to use as a family computer.

Just for clarity, this article covers installing Ubuntu 22.04 on a late 2009 iMac with a Mobility Radeon HD 4850 graphics card. If you have a different model or graphics card YMMV.

I had originally planned to install Ubuntu 24.04 on the iMac but after installing I was experiencing near constant glitching on the monitor which is pretty widely reported from doing some research (and none of the suggested fixes seemed to help) I decided to use 22.04 which is not EOL until April 2027 so hopefully these issues will have subsided by then!

IMPORTANT: Due to various issues with drivers etc, you will need a second monitor and Thunderbolt adapter. I purchased this adapter from Amazon which worked perfectly, especially given the price!

Photo by Alex Bachor on Unsplash

Preparation

To install Ubuntu I first downloaded the 22.04 release of Ubuntu Desktop ISO from here: https://releases.ubuntu.com/jammy/

From my Macbook Pro I flashed the ISO to a spare USB I had lying around using balenaEtcher (https://balena.io/etcher/) using all the default settings.

Next, I connected my second monitor to the iMac using the Thunderbolt adapter and inserted theUSB disk with the Ubuntu install media flashed onto it.

Replacing the HDD

As a recommendation if you are taking this journey.. I would first suggest replacing the old HDD in the iMac with an SSD to improve the responsiveness of the system as you may experience sluggishness.

If you don’t wish to do this, feel free to skip this optional step.

In order to replace the HDD in the Mac, you will need some suction cups to remove the glass from the front of the unit. I purchased these from Amazon which did the job nicely (again, considering the price!).

Small note, you don’t have to pull as hard as you think to get the glass off the unit as it’s only held in place using magnets.

I won’t reinvent the wheel here by documenting how to replace the HDD in the Mac, I followed this video here on Youtube which worked perfectly: https://www.youtube.com/watch?v=oKWaLcD0cb4.

Installing Ubuntu

When you are ready to go, power up the iMac using the power button at the back left of the display.

As soon as you see the white screen on your Mac, start holding the alt key on the Keyboard until you see the disk selection window — Click on your USB device to launch from USB and select Install Ubuntu from the options menu.

Follow through the Ubuntu installation as normal and remove the USB disk when prompted.

Getting the main display working

After rebooting following the installation, you will likely find that the main iMac display is flickering and you have a dark grey screen on your second display.

Not to fear! Ubuntu is sitting at the login screen on the main monitor but it’s not visible due to driver issues on the main display.

Press [return] to enter the password prompt and blindly enter your password and hope you get it right!

If your second screen does not go grey and stays black for some time — It’s possible that Ubuntu hasn’t launched correctly (I had this on one attempt at doing this, but restarting the iMac via the power button at the back cleared the issue — Didn’t investigate further..).

Wait a few seconds and you should see the familiar Ubuntu desktop on your second display. When it loads full screen, move your mouse to the right until you see the cursor, before right clicking and select Display Settings so we can disable the primary monitor for now and work on the second screen.

Now we’re going to install the graphics drivers. Head over to the AMD graphics drivers download page (https://www.amd.com/en/support/download/linux-drivers.html) and download and install the drivers for Ubuntu 24.04.

Once these have installed, you will need to open your terminal and run the and run the following commands as root:

sudo su # su to root user
apt-get update && apt-get upgrade -y # Install any available updates for good measure
amdgpu-install # Install the amdgpu tool package

Leave this to run (it will take some time to complete, don’t worry it probably hasn’t hung) until it has completed before restarting the iMac.

After rebooting you should find yourself at the Ubuntu login screen again, this time on your main display!

Wrap up

This was a fun exercise getting Ubuntu installed on an aging iMac, and I now have a spare desktop machine running a supported OS (though less space on my already crowded desk!

Hope you have found this an interesting read, please follow for more of the same! 🙇

--

--