How to Fix errors by manually flashing Marshmallow update
镜像下载for nexus Factory image
Step 1: Download the [Marshmallow factory image](http://www.theandroidsoul.com/download-mra58k-android-6-0-marshmallow-update-released-for-nexus-5-nexus-6-nexus-9-nexus-7-2013-and-nexus-player-84708/) for your device.
Step 2. Extract the .tgz file you downloaded into a separate folder. You will radio and bootloader .img files, and a big image-something.zip file.
Step 3. Extract the .zip file (name begins with image) inside that folder to a new folder. Rename the new folder as update6
Step 4. Now, move the radio and bootloader file from step 2, to new folder update6 in step 3.
Step 5. You must have these files in update6 folder:
userdata.img system.img recovery.img cache.img boot.img radio*.img
bootloader*.img
(You will have long filename in place of * in radio and bootloader files above.)
Once you have those 7 files in one folder, proceed to next step.
Step 6. Disconnect your Nexus device from PC if it’s connected.
Step 7. Install ADB and fastboot drivers on your PC.
Step 8. Boot your Nexus device into bootloader/fastboot mode:
Power off the device.
Press and hold both Volume Down and Power button together until you see anything on screen. Fastboot should be written at top.
Step 9. Connect your Nexus device to PC now using USB cable.
Step 10. Open a command window into that folder. For this, with update6 folder open, click on the address bar, delete current text there, and just type cmd. This will open up a command window wit its location set at update6 folder.
(You can also do shift+right click, and then choose open command window here.)
Step 11. Enter the following command to test whether fastboot is working alright or not. If it’s working good, you should get a serial no.
fastboot devices
Step 12. Install the Marshmallow update. For this, enter the following command one by one:
fastboot flash bootloader name-of-your-bootloader-image-file.img
→ Be sure to replace the text name-of-your-bootloader-image-file.img with the filename of the bootloader file you got from factory image.
fastboot reboot-bootloader
fastboot flash radio name-of-your-radio-image-file.img
→ Be sure to replace the text name-of-your-radio-image-file.img with the filename of the radio file you got from factory image.
fastboot reboot-bootloader
fastboot flash system system.img
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot erase cache
fastboot reboot
Step 13. When done, reboot your device if required. Either choose reboot menu using volume buttons on device, or run the command fastboot reboot into cmd window for this.
That’s it. Once all files are installed, your Nexus device will have the MRA58K build running.
More Fixes
→ Btw, if you still get error flashing the image file, then try to use the latest fastboot files that were released with the Marshmallow update. You can download the latest files linked just before, and then extract the 4 files from the zip package, and transfer the 4 files to the update6 folder where you already have system.img and other files. Then try flashing the system.img file again using the command given for it above, and it should be success.
→ Also, make sure you have some 3GB space free on your Android device, as that could play a role when flashing factory image too.
Need help? Let us know if you face any difficulty with this via comments section below.