You'll need:
- An Ubuntu ISO downloaded from here
- USB stick
$ hdiutil convert -format UDRW ~/Downloads/ubuntu-18.04.1-desktop-amd64.img -o ~/Downloads/ubuntu-18.04.1-desktop-amd64.iso
$ diskutil unmountDisk /dev/disk3
$ sudo dd if=~/Downloads/ubuntu-18.04.1-desktop-amd64.img.dmg of=/dev/rdisk3 bs=1m