Want to install the latest Android 6.0 Marshmallow official firmware on your Nexus 5, 6, 7, or 9? You can use this method if you already have a rooted device with unlocked bootloader.
Step 1. Download fastboot.zip, USB drivers (for Windows), 7Zip (for extracting the firmware files), and the latest Nexus firmware for your model.
Download:
Step 2. Unzip both fastboot.zip and USB drivers zip files.
Step 3. Unzip the Nexus firmware ending in .tgz. You should get a file ending in .tar, unzip that also and you should end up with a folder with firmware image files.
Step 4. Unzip the zip file inside the firmware folder starting with “image” and ending with “.zip”. This should give you a bunch of files ending in .img. Copy both “boot.img” and “system.img” file to the “fastboot” folder.
Step 5. Also copy over “bootloader-xxx.img” and “radio-xxx.img” file from the firmware folder to the fastboot folder. (Note: “xxx” means that part of the filename may be different depending on your device of Nexus.)
Step 6. Open up a command prompt/terminal and type:
For Windows:
cd Downloads
cd fastboot
fastboot flash bootloader bootloader-xxx.img
fastboot reboot-bootloader
fastboot flash radio radio-xxx.img
IMPORTANT: Replace “xxx” with the actual filename!!! Or you can also type the first 3 letters and hit the Tab key on your keyboard as it will fill it out for you automatically!
fastboot reboot-bootloader
fastboot flash boot boot.img
fastboot reboot-bootloader
fastboot flash system system.img
IMPORTANT: If you get error for fastboot in this line, try using “mfastboot flash system system.img” instead!!!
For Mac:
cd Downloads
cd fastboot
chmod 755 *
./fastboot-mac flash bootloader bootloader-xxx.img
./fastboot-mac reboot-bootloader
./fastboot-mac flash radio radio-xxx.img
IMPORTANT: Replace “xxx” with the actual filename!!! Or you can also type the first 3 letters and hit the Tab key on your keyboard as it will fill it out for you automatically!
./fastboot-mac reboot-bootloader
./fastboot-mac flash boot boot.img
./fastboot-mac reboot-bootloader
./fastboot-mac flash system system.img
IMPORTANT: If you get error for fastboot in this line, try using “./mfastboot-mac flash system system.img” instead!!!
For Linux/Ubuntu:
cd Downloads
cd fastboot
chmod 755 *
./fastboot-linux flash bootloader bootloader-xxx.img
./fastboot-linux reboot-bootloader
./fastboot-linux flash radio radio-xxx.img
IMPORTANT: Replace “xxx” with the actual filename!!! Or you can also type the first 3 letters and hit the Tab key on your keyboard as it will fill it out for you automatically!
./fastboot-linux reboot-bootloader
./fastboot-linux flash boot boot.img
./fastboot-linux reboot-bootloader
./fastboot-linux flash system system.img
IMPORTANT: If you get error for fastboot in this line, try using “./mfastboot-linux flash system system.img” instead!!!
Step 7. That’s pretty much it. If you are coming from a stock ROM, you will not need to do a factory reset/wipe and it should reboot with all of your user data. However, if coming from a custom ROM, you may need to do a factory reset/wipe in TWRP or CWM recovery.