How to root or update a Nexus Android using only open source tools (in Linux).


Last updated: November 9, 2017.

This is a simple guide to updating and rooting a Nexus device using Linux, and entirely open source tools.

This guide assumes you have unlocked your bootloader.



To update Android.


1. Download the latest factory image from Google.

Visit the Factory Images for Nexus and Pixel Devices page, locate your device, and download the latest update.

For this guide, I'm using a Nexus 6P.

As of updating this article, the latest version of Android for the Nexus 6P (angler) is 8.0.0 (OPR5.170623.011, Nov 2017).

The update will download as a ZIP file. Extract it.


2. Install ADB and Fastboot.

sudo apt update

sudo apt install adb fastboot


3. Update.

First, place your device into USB debugging mode via Settings > Developer options > Enable USB Debugging.

You may need to enable Developer options.

Move to your extracted ZIP archive.

cd ~/Downloads/angler-n2g47w

Start ADB and check for your device. A prompt will likely appear on your device seeking approval. Accept it.

sudo adb devices

Boot your device into fastboot mode.

sudo adb reboot-bootloader

Flash the updated bootloader.

sudo fastboot flash bootloader bootloader-angler-angler-03.77.img

sudo fastboot reboot-bootloader

Flash the updated radio.

sudo fastboot flash radio radio-angler-angler-03.84.img

sudo fastboot reboot-bootloader

Finally, update fully. This command will not wipe your device.

sudo fastboot update image-angler-opr5.170623.011.zip

Congratulations. Your device will reboot normally, with an updated firmware.


To root Android.

Traditionally, SuperSU by Chainfire has been used to root Android devices. SuperSU was recently sold to a third-party, and was never open source even under Chainfire.

In this guide, I'll be using Magisk - which is open source.


1. Download Magisk, and other, dependancies.

Download the Magisk flashable ZIP from here.

Download the Magisk Manager APK from here.

And, finally, download TWRP from here. This will be an IMG file.

Move these dependancies to your device, excluding TWRP.


2. Boot temporarily to TWRP.

sudo adb reboot-bootloader

sudo fastboot boot ~/Downloads/twrp-3.1.1-0-angler.img

On your device, select not to alter the system partition, and enter your device password/PIN code.


3. Flash Magisk.

In TWRP, select to flash a ZIP. Find the Magisk ZIP on your internal storage, and flash it normally.

Finally, reboot your device. Do not opt to install any TWRP app.


4. Install Magisk Manager.

Using a file manager, install the Magisk Manager APK.

Amaze File Manager is open source.

You should now have root access, managable via the Magisk Manager app.



Comments are provided by Disqus. To respect user privacy, Disqus is only loaded on user prompt.

I recommend uBlock Origin to protect against Disqus tracking and advertising.