Download and install rEFInd
To install it, unzip and open the downloaded folder in Finder. Find the install script called refind-install and double click it. This will will open up a new Terminal and you'll have to enter your password and confirm your intent a few times. That should complete the installation.
Shut down your Mac
Shut down your Mac completely - a full shutdown, not a restart. Then boot up again. Upon boot, you should see the boot manager screen.
Shrink the OS X partition
At this point, we'll have to shrink the OS X partition and make room for our Linux installation.
Press Cmd + Space, then type Disk Utility.
Select your Mac's hard drive on the left, and click Partition on the right. You will then be prompted to resize the existing partition. Don't add a partition, simply shrink the existing one. You can decide how much space you want to allocate to each operating system. Since I've got a 256gb SSD, I'm going to give 32gb to Ubuntu and 224gb to OS X. So I'll shrink my Macintosh HD to 224gb.
Make a bootable USB drive
For this guide, we're going to use a USB stick to install Ubuntu. Follow our guide for how to make a bootable USB drive on Mac.
Reboot and install Linux
Reboot your computer, and when it comes back up rEFInd will find the bootable USB and give you the option to open the installer. Click on the installer and follow the installation instructions for your OS.
Make sure you check the option to "Install Ubuntu alongside Mac OS X" (for Ubuntu) to make sure you don't overwrite