> ## Content Index
> Fetch the complete content index at: https://itsfoss.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Restore Android Factory Image In Nexus 7 2013 In Linux
- URL: https://itsfoss.com/restore-android-factory-nexus-7-2013-linux/
- Published: 2014-03-16T20:28:53.000Z
- Updated: 2023-01-11T09:56:06.000Z
- Author: Abhishek Prakash
- Tags: #Import 2022-12-26 08:27

[![Restore stock android factory image in Nexus 7 2013 in Linux](https://itsfoss.com/content/images/wordpress/2014/03/Google_Nexus_2013.jpg)](https://itsfoss.com/content/images/wordpress/2014/03/Google%5FNexus%5F2013.jpg)

The other day I installed [Ubuntu Touch in Nexus 7 2013](https://itsfoss.com/install-ubuntu-touch-nexus-7-2013/ "Guide To Install Ubuntu Touch On Nexus 7 2013"). Since it’s quite unstable and I was kind of missing Android games, I decided to restore Android back in Nexus 7 2013\. I plan to dual boot Android and Ubuntu Touch, may be sometime soon.

In this tutorial we shall see how to restore Android factory image in Nexus 7 2013 in Linux. Let’s take a look at prerequisites first.

- Nexus 7 2013 with unlocked bootloader. See this article to learn [how to unlock Nexus 7 2013 bootloader](https://itsfoss.com/unlock-bootloader-nexus-7-linux/ "How To Unlock Bootloader Of Nexus 7 2013 In Ubuntu Linux").
- USB cable
- A computer with internet connection running on Linux, preferably Ubuntu or Ubuntu based Linux distributions.

## Install Android factory image in Nexus 7 2013:

When you have all things ready, lets see the steps install Android factory image:

### Step 1: Get Android factory image

First thing that you need is to get the correct Android factory image. You can get the factory images from Google [here](https://developers.google.com/android/nexus/images?ref=itsfoss.com). It is important to get the correct image. Nexus 7 2013 is codenamed Razor (and not Razorg which is for 3G version).

### Step 2: Extract the image and go in the directory

Once you have downloaded the correct image, extract it and go in the directory, in terminal. I presume that you know how to move around in directories in Linux terminal.

### Step 3: Install the Android image to Nexus

Now is the time to install the image. Boot in to the bootloader with the following command:

```
adb reboot bootloader
```

By this time you shall see the Nexus device has been booted in the bootloader. While in the extracted directory, run a file named **flash-all.sh** using the following command:

```
sudo ./flash-all.sh
```

It will not take a lot of time for the image to be installed. But once the image is flashed to Nexus, you’ll see that it has booted in Android and four colored balls are bouncing. have patience as it will stay like this for some time. Afterwards, you’ll be provided with options to choose your language, Google account etc like you did for the first time you used Nexus.

### Possible troubleshooting:

While flashing the image, if you see an error like this:

*checking product…*  
*FAILED*

*Device product is ‘flo’.*  
*Update requires ‘deb’.*

It is an indication that you downloaded the wrong image. It’s a sort of protection to prevent you from installing the wrong image in Nexus. Check again and download the right image.

I hope this article helped you to restore stock Android factory image in Nexus 7 2013 in Linux. Any question or suggestion is always welcomed.