This is what you want if you have a Nexus device but you've never heard of/don't use MultiROM. You should have an unlocked bootloader. If you don't have this, take a look at the useful CM guide to unlock your bootloader.
Also, make sure you have adb and fastboot installed and know how to use it. Backup any and all data beforehand (doing a nandroid backup is probably best)
- Grab the Marshmallow factory image from here. The Nexus 5's codename is
hammerhead and you're looking for the
6.0.0 (MRA58K) file.
- Check the checksum of your downloaded file against the one listed on the page just to be safe. This ensures the download went smoothly and you don't accidentally flash corrupted version onto your device
- Untar the downloaded file, extracting
- Connect your phone to your computer via the microusb cable. Use
adb devices to make sure adb is working fine (turn Developer mode and USB debugging on first).
adb reboot bootloader to enter fastboot mode
- In Linux/OSX,
cd to the folder containing the extracted files and run
sh ./flash-all.sh to flash everything. If you're running Windows, double-click the
- Your device should automatically reboot to your new Marshmallow system. (Note that the first boot might be agonisingly long)
Here's what you want if you use MultiROM. This method has the benefit of allowing you to keep your old system and all your existing data. You can then easily switch between Marshmallow and whatever you were running previously.
You should have an unlocked bootloader and a custom recovery like TWRP installed, of course.
- Grab the MultiROM-flashable zip from this XDA thread. (You may also want to grab and flash the
radio.img if you didn't install the Developer Previews.)
- Reboot to your custom recovery and add a new ROM in the MultiROM menu.
adb sideload hammerhead_mra58k.zip (or
adb push beforehand) to transfer the zip file to your device
- After installation, reboot and choose the Marshmallow ROM to boot into