Skip to content

Instantly share code, notes, and snippets.

@trebled-tech
Last active August 31, 2024 22:17
Show Gist options
  • Save trebled-tech/b7cd747415d819fdddab8d20d475616a to your computer and use it in GitHub Desktop.
Save trebled-tech/b7cd747415d819fdddab8d20d475616a to your computer and use it in GitHub Desktop.
install Linux on an Intel Mac
install Linux on an Intel Mac
instructions assume the following:
you are preparing the Linux installer on a Mac running macOS 14.6
(older versions of macOS may reference some specifics with slightly different naming in Disk Utility, but the logic is the same going back to macOS 10.11)
for the purposes of this tutorial, Linux = Elementary OS 7.1
essentially a stripped-down Ubuntu with a much better UI and a separate app store layer that will feel very familiar to those who have used Apple's App Store
how to install Elementary OS 7.1
https://www.youtube.com/watch?v=31M6XtYDaho
somewhat annoying music, and really only the first half of the video is required for general install and software update needs
https://elementary.io/docs/installation#installation
this has good general info and a different installation video that may be useful
get the ISO install image
you will need a minimum 8GB USB flash drive
4GB might work, but 8GB is a sure thing
the drive will be completely overwritten, so make sure it doesn't have anything on it you want to keep
go to https://elementary.io
you can pay however much you like for it, down to $0, and $0 will reveal a download button, which downloads an ISO file
prepare the USB flash drive
the easiest way to do this is using the Disk Utility app and a command-line utility called 'dd'
plug in the USB stick
open the Disk Utility app (in /Applications/Utilities/)
click the disk's top-level in the left-hand pane
note 'Partition Map' field: if the target disk is not already partitioned as 'Master Boot Record', erase and re-partition the disk
right-click the disk's top level in Disk Utility, choose 'Erase', and select
Name: leave as-is
Format: MS-DOS (FAT)
Scheme: Master Boot Record
once the disk is prepared, note the Device field, e.g. disk3
unmount the volume, but NOT the disk, from the left-hand pane
most likely the volume will be an entry under the disk called 'NO NAME' - eject this, but not the parent entry above it
launch the Terminal app (also in /Applications/Utilities/)
we use a data transfer utility called 'dd' to write the ISO file's contents to the USB flash drive, e.g.
dd if=/Users/mc3/Downloads/elementaryos-7.1-stable.20230926rc.iso of=/dev/disk3 bs=4m
'if' means input file, so this is the full path to the ISO file downloaded above
'of' means output file, thus the USB drive (this is where the "disk#" info noted above becomes relevant)
'bs' means block size, and while it can influence many things, here means how much data is read from the ISO each pass before an attempt to write is made to the USB flash... 4m is a safe value that won't take forever
become the root user using the command 'sudo su -', then enter your usual macOS password
enter the dd command, modified as necessary for your system, from the above example, and press Enter
writing process will take a while, but once completed, you should see a summary of the actions it took
install rEFInd EFI bootloader
this is a more flexible means of managing non-macOS booting, with the alternative being the less friendly and less flexible 'hold down the Option key after the startup chime'
just the paste the following into your web browser to download the current rEFInd installer
https://sourceforge.net/projects/refind/files/0.14.2/refind-bin-0.14.2.zip
uncompress the downloaded file (if it doesn't do so automatically)
if you like, read the README.txt file inside the resulting folder
launch the Terminal app (also in /Applications/Utilities/)
become root user using the command 'sudo su -', then enter your usual macOS password
run the rEFInd install script (you can just drag and drop 'refind-install' from the Finder window onto the Terminal app's window, and then press Enter in Terminal app)
if you get an alert about "SIP ENABLED!", use your phone to take a photo of the instructions, then follow those instructions to run the installer from Recovery Mode
older versions of macOS do not have SIP, which was introduced in macOS 10.11
SIP background: https://en.wikipedia.org/wiki/System_Integrity_Protection
boot to USB flash installer and follow install steps
reboot your Mac and choose the Elementary OS installer icon from rEFInd, which will probably be a circular orange icon
follow the steps as outlined in the video links recommended above
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment