Installing Ubuntu 16.04 on a Raspberry Pi 3

I ran into some grief trying to install Ubuntu Classic Server 16.04 for the Raspberry Pi 3, using the image from Ubuntu Pi Flavour Maker. It installs fine, and runs well, which is great for compatibility! Unfortunately, after running: would be standard for any fresh installation of Ubuntu/Debian, an error to do with linux-firmware appears:

Preparing to unpack .../linux-firmware_1.157.10_all.deb ...
Unpacking linux-firmware (1.157.10) over (1.157.8) ...
dpkg: error processing archive /var/cache/apt/archives/linux-firmware_1.157.10_all.deb (--unpack): trying to overwrite '/lib/firmware/brcm/brcmfmac43430-sdio.bin', which is also in package linux-firmware-raspi2 1.20161020-0ubuntu1~0.2~rpi3
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)

Hmmm. Let's ignore it and reboot. Oh no! The device seems to be bricked! If you're running in headless mode, as I usually am, this can be a real pain.

The problem? It turns out that one of the upgrades creates a weird conflict, which results in a thing called uboot not being able to find a thing called an FDT memory address. Andreas Hosl worked out the solution. To fix the uboot error according to his instructions:

Or, as a single line:

sudo apt update && sudo sed -i 's/device_tree_address=0x100/device_tree_address=0x02008000/' /boot/firmware/config.txt && sudo sed -i 's/device_tree_end=0x8000/#device_tree_end=0x8000/' /boot/firmware/config.txt && sudo apt dist-upgrade -y

Problem solved! Hope this helps.