To save me from looking this information up everytime, here are the steps to update a rooted, stock Android 6 Nexus 5 phone.
- Reboot phone in recovery mode and make a backup
- Copy the backup to a computer
$ adb pull /sdcard/TWRP
- Reboot in fastboot mode
$ adb reboot bootloader
- Flash bootloader:
$ fastboot flash bootloader bootloader-hammerhead-{version}.img
- Flash radio:
$ fastboot flash radio radio-hammerhead-{version}.img
- Flash boot:
$ fastboot flash boot image-hammerhead-{version}/boot.img
- Flash system:
$ fastbot flash system image-hammerhead-{version}/system.img
- Flash cache:
$ fastboot flash cache image-hammerhead-{version}/cache.img
- Flash recovery (TWRP has been erased):
$ fastboot flash recovery twrp-{version}-hammerhead.img
- Every step:
fastboot -s $PHONE flash bootloader bootloader-hammerhead-$BOOTLOADER_VER.img && fastboot -s $PHONE flash radio radio-hammerhead-$RADIO_VER.img && fastboot -s $PHONE flash boot image-hammerhead-$IMG_VER/boot.img && fastboot -s $PHONE flash system image-hammerhead-$IMG_VER/system.img && fastboot -s $PHONE flash cache image-hammerhead-$IMG_VER/cache.img && fastboot -s $PHONE flash recovery ../twrp-3.0.2-0-hammerhead.img
- Go to recovery
- If TWRP offers it, make
/system
read-only - Sideload SuperSU and wipe cache + Dalvik
- Do not let TWRP install SuperSU
- Reboot system (may loop a few times)
- Re-run AdAway