Skip to content

Instantly share code, notes, and snippets.

@ApophisLee
Forked from nsgrantham/make-ubuntu-bootable-usb-on-macos.md
Last active August 8, 2024 15:52
Show Gist options
  • Select an option

  • Save ApophisLee/34e8bc77ad461a88d79c3fa1440e0ad6 to your computer and use it in GitHub Desktop.

Select an option

Save ApophisLee/34e8bc77ad461a88d79c3fa1440e0ad6 to your computer and use it in GitHub Desktop.
https://help.ubuntu.com/community/How%20to%20install%20Ubuntu%20on%20MacBook%20using%20USB%20Stick

Make a Ubuntu 16.04 bootable USB on macOS

Begin with the USB flashdrive unplugged from your computer.

Download the Ubuntu 16.04 64-bit desktop image from http://releases.ubuntu.com/16.04/

curl -O http://releases.ubuntu.com/16.04/ubuntu-16.04.6-desktop-amd64.iso

Convert the .iso file to .img with hdiutil

hdiutil convert -format UDRW -o ubuntu-16.04.6-desktop-amd64.img ubuntu-16.04.6-desktop-amd64.iso

Remove the .dmg file extension that macOS adds automatically (annoying!)

mv ubuntu-16.04.6-desktop-amd64.img.dmg ubuntu-16.04.6-desktop-amd64.img

List the current devices connected to your machine.

diskutil list

Now plug in your USB flashdrive and list the current devices again.

diskutil list

Identify the new device node assigned to your USB flashdrive. In my case, this is /dev/disk2.

Unmount the disk.

diskutil unmountDisk /dev/disk2

Write the image file onto the USB. This step may take several minutes.

sudo dd if=ubuntu-16.04.6-desktop-amd64.img of=/dev/rdisk2 bs=1m

When this is complete, you may get a warning that the disk isn't readable by your machine. That's fine, hit 'Ignore'.

Finally, eject the USB flashdrive.

diskutil eject /dev/disk2

Remove your USB flashdrive from the machine and you're good to go!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment