The best part about buying Nexus devices is the fact that the are among the first to receive updates to the latest and greatest versions of Android! These updates are pretty easy to flash for the power user. The only issue has been in the way that Google packages the stock images since the Lollipop updates. They include a “flash-all.bat”, but this bat file is broken and yields a “missing system.img” error if you try to use it.
RootJunky has uploaded his own repackaged version of the files which can be found at the link below. His stock image replaces the flash-all.bat with a bat file that actually works. He has also added a no wipe version of the flash-all.bat which will not wipe your data like the standard version does. This is the easiest way to install the latest and greatest firmware to your Nexus device. If you are not familiar with the process just follow the guide below.
How To Install Android 6.0 Marshmallow Without Wiping Data.
Step 1: You will need to set up Fastboot and ADB on your PC. You can do this in 15 seconds with the 15 second ADB installer.
Step 2: Next download the stock image for your device.
Step 3: unzip your stock image to a folder on the desktop
Step 4: Open up your folder, Shift and right click to “open command prompt here” (this opens the command prompt from within the folder)
Step 5: Boot your phone into fastboot mode, power off, hold volume down+power, and connect your device to your PC.
Step 6: in the command prompt type “fastboot devices” to verify the PC sees your phone in fastboot mode (if a device shows up be sure you have fastboot and usb drivers installed)
Step 7: Next type the command “flash-all.bat” if you want to flash the image and wipe data or “flash-no-wipe.bat” if you don’t want it to wipe the data. (just the command not without the quotes)
This will take about 10 minutes total to flash. Once it finishes you will Select start from the fastboot menu on your phone to restart your device. Enjoy your fresh new install of Android 6.0 Marshmallow on your device!