Giving A Second Life To My Nexus 7 2013 Tablet

I was a big fan of the Nexus products brought by Google with pure Android experience, and I enjoyed repairing their hardware myself when they were broken, I repaired Nexus phones and tablets (4/5/7) screens, batteries, buttons, and chargers dozen times, but I’ve never had to change their native Android OS.

Here I’m trying to give a second life to my Nexus 7 (2013) LTE that is still in a perfect condition, sleeping in my library between books, with an obsolete Android 6.0.1 and a security patch of May 2016.

In this post I’ll document the different ways and tools I’m trying to bring a recent and up to date Android versions in a Nexus 7 (2013) LTE, please note that this is a work in progress, so I’ll add new details from time to time.

Initial Conditions:
Nexus 7 2013 LTE
Android version: 6.0.1
Android security patch level: May 2016
VARIANT – deb 32G
HW VERSION – rev_e
BASEBADN VERSION – DEB-Z00_2.44.0_0213
SECURE BOOT – enabled
LOCK STATE – locked
–> Never altered anything in the tablet: No root, no specific bootloader or recovery, no oem unlock…etc.

Step 0: Backup
Never say it enough, the next steps will remove everything on the tablet, so if you have important files and data save them.

Step 1: Install TWRP
From what I know, the first step is to install TWRP that will allow me to install any specific ROM with more options.
TWRP replaces the default stock recovery mode of Android, it needs unlocked bootloader, and that means that the tablet reset will not be the same as before.

Here is the official tutorial to install TWRP on Nexus 7 2013 LTE :
Since I have non root device and no installed TWRP app, I’ll follow the Fastboot Install Method.

Fastboot Install Method requires ADB and Fastboot tool that I already have on my PC.
It requires also to enable USB debugging.

For ADB/Fastboot, download them from Android website here:

To enable USB debug: Options -> Developer options -> Toggle on the “USB debugging”.
(If you see a pop up asking for permission for the PC, accept it)
If you don’t see the Developer options menu: Options -> About tablet -> Press 7x Build number

You can test Android tools and USB debugging by making a simple reboot.
Open a command console, go to the ADB directory and:
adb reboot

Download latest TWRP for Nexus 7 2013 here:
Note: “deb” is the codename of the tablet, not to be confused with debian or deb package of Linux.
Copy it in the ADB directory.

Reboot the tablet in bootloader mode:
adb reboot bootloader

Flash the TWRP image as recovery:
fastboot flash recovery twrp-3.1.1-0deb.img

Doing that without unlocking the bootloader gives the below error:
FAILED (remote: ‘Bootloader is locked.’)

Unlocking the bootloader with the command:
fastboot oem unlock

Select “Yes” with volume buttons, and confirm with ON/OFF button.
As I mentioned before all data will be lost.

This will take about a minute, after that the bootloader screen will show again, and the line LOCK STATE will be “unlocked”.

Try again to flash the TWRP image as recovery:
fastboot flash recovery twrp-3.1.1-0deb.img

This time it should work correctly.

Reboot the tablet:
fastboot reboot

The tablet reboot in TWRP UI, but after some time it shows red errors:
Failed to mount ‘/data’ (Invalid argument)
The tablet will be in a loop reboot again and again showing the same errors.

I think that this is because TWRP can’t access or decrypt my data partition (that I don’t care about anyway…)
Trying to wipe my data: Turn OFF the phone, then press ON & Volume down to be in bootloader menu.
Wipe user data and reboot in TWRP recovery:
fastboot format userdata
fastboot reboot recovery
I don’t see anymore the errors in TWRP console start up, after 2 tries to boot in recovery, I can see TWRP menu.

Swipe to allow modifications.
Now I have all the options to install/wipe/backup/restore… ROMs on my tablet.

The next step? Find a good ROM and install it!

Step 1: Install LineageOS

This distribution is recommended as lightweight, not too much different from stock version and with more options.
LineageOS is the old famous Cyanogen(Mod) ROM.

Nexus 7 is no more supported by LineageOS, There is two options to have it:
1- Build yourself the image following the instructions:
2- Use an image built by someone else, the recent one I found is in XDA forums: [ROM][UNOFFICIAL][9] LineageOS 16.0 [deb][flo]

To go fast and just have a look to the UI and overall system I’ll use directly the latest image built downloaded here: (Size 7363Mo)

It is recommended to install Open GApps at the same time, otherwise it will not be possible to configure a Google account, download apps…etc. Download it here, choose as configuration ARM/9.0/Pico.

Copy the two zip file in the ADB directory.
Boot the tablet in recovery mode of TWRP.
Wipe the partitions (system, data, …)
Go back and select Advanced -> Sideload, adnd swipe to confirm.
(Sideload gives the possibility to install zip images from the PC.)

On PC side, check it:
adb devices

It should show the serial number of the tablet and the status sideload

Flash the LineageOS image:
adb sideload

You can see the percentage progress in the console and in the TWRP UI.

Honestly I don’t know if I have to install the two zip simultaneously (I think there is a way to select them but not in sideload) or one after the other, so I did first LineageOS, then went back to sideload again and started for Open GApps.
adb sideload

Anyway the Open GApps didn’t work with error 64, I did an error, the tablet architecture is ARM, not ARM64 as I selected in the website.
Downloaded the correct version again: (93MB)
adb sideload
The installation failed for another reason this time (error 70), saying insufficient storage space in system partition, knowing that I chose the very small version Nano…
Is this due to the Android 9 version that takes all the system partition of a 2013 device?
Comparing LineageOS image to last Google image there is +200MB more.
That said, trying to install Open GApps stock with 600MB will be a big challenge later…

I found in TWRP menu a way to resize the system partition:
Wipe -> Advanced Wipe -> Check “System” partition -> Repair or Change File System
Here you can find the information about the partition:
Present: Yes
Removable: No
Size: 837MB
Used: 782MB
Free: 55MB
Backup Size: 782MB

The free space of 55MB isn’t sufficient for any Open GApps version even the Nano with 93MB.

Pressing the button “Resize File System” has no effect and I don’t see how to specify the size to take from Data partition.

At this level I think I need to find a way to change the Nexus partition, and this is a normal issue since I’m trying to install recent OS that are bigger than the ones used back to 2013.

To be continued.


Step 1: Install Ubuntu Touch

I just discovered a great alternative to Android that I can install in my Nexus 7 : Ubuntu Touch.
Nexus 7 is one of a list of devices that are supported with up to date software.

You can install it using depending on your pc OS, the following instructions are for my Ubuntu PC.

Install ADB if not already done:
sudo apt install adb fastboot

Create a folder where you will save OS images (in tmp if you don’t want to keep them) :
mkdir ubuntutouch
cd ubuntutouch

Execute the next commands in the folder to download and check:
wget -O recovery.img && echo "432ee1d970b3b18e74fc80e5c0d091d87598505fe371676b80d20b16df2ea089 recovery.img" | sha256sum -c
mkdir pool gpg
wget -O pool/ubports-a1f443971032f2b6a03ed6f83d3340e026d59bfbe1625b259fb77eb05fa2b6a9.tar.xz && echo "84274fa597150533c8ea26a4a0e6737c2e5810cc752458ab53b596b79c941389 pool/ubports-a1f443971032f2b6a03ed6f83d3340e026d59bfbe1625b259fb77eb05fa2b6a9.tar.xz" | sha256sum -c
wget -O pool/ubports-a1f443971032f2b6a03ed6f83d3340e026d59bfbe1625b259fb77eb05fa2b6a9.tar.xz.asc && echo OK
wget -O pool/device-63b6937bca770c2f484847f557fe75e579cb5eeef013c11e1dea661644dd13fc.tar.xz && echo "d85035887a8385d4eef1ccbcf0f56d974d15595d428194a207639411c8739b49 pool/device-63b6937bca770c2f484847f557fe75e579cb5eeef013c11e1dea661644dd13fc.tar.xz" | sha256sum -c
wget -O pool/device-63b6937bca770c2f484847f557fe75e579cb5eeef013c11e1dea661644dd13fc.tar.xz.asc && echo OK
wget -O pool/keyring-4c4e7ef380ebcfa2c31084efa199138e93bfed8fc58aa3eb06bdf75a78af9b57.tar.xz && echo "5b6e870acf8944330acb2a9dad6f5270bd06c377603a3115f805290e989ab421 pool/keyring-4c4e7ef380ebcfa2c31084efa199138e93bfed8fc58aa3eb06bdf75a78af9b57.tar.xz" | sha256sum -c
wget -O pool/keyring-4c4e7ef380ebcfa2c31084efa199138e93bfed8fc58aa3eb06bdf75a78af9b57.tar.xz.asc && echo OK
wget -O pool/version-9.tar.xz && echo "e113f885607c9aa6a45ee60cf6cf2d546ea411d0b46ac486050435e5624bc6b3 pool/version-9.tar.xz" | sha256sum -c
wget -O pool/version-9.tar.xz.asc && echo OK
wget -O gpg/image-signing.tar.xz && echo OK
wget -O gpg/image-signing.tar.xz.asc && echo OK
wget -O gpg/image-master.tar.xz && echo OK
wget -O gpg/image-master.tar.xz.asc && echo OK

On the tablet you have to enable the USB debug.
My tablet bootloader is already unlocked.

Reboot on bootloader:
adb reboot bootloader

Wipe data and system:

fastboot format userdata
fastboot format system

Log story short, Ubuntu Touch isn’t what I’m looking for, it is not very helpful with only the touchscreen.
That said, it is very good designed and Linux users may like it.


Featured image source:

11 Responses

  1. K. Koontz at | | Reply

    You need to 1) repartition the Nexus 7 to run an Android 9+ ROM and run an updated version of TWRP that accomodates this change You can read about it at this thread on XDA: The other thing people tend not to notice is that if you have only a 16 gb Nexus 7 you’ll have a harder time flashing a Lineage OS ROM based on Android 9. No idea why honestly. I’ve got a 16 gb “flo” Nexus 7 and a 32 gb “deb” Nexus 7 and have used the file to repartition both and install the modified TWRP recovery (that ends in _UA) on both. I can install Lineage ROMS fine on the deb device with 32 gb onboard but only AICP ROM and AOSP extended seem to run on the flo Nexus 7. The latter two run just fine once I flash either of those two ROM and use the “pico” version of Open GApps to install on the newly sized data partition. I hope this helps.

  2. K. Koontz at | | Reply

    This is another alleged solution but one that I have not personally tried. This is the AICP ROM that I’ve found to be the best, most recent one (in Sept 2019) for my flo Nexus 7.

  3. J at | | Reply

    I put LineageOS on my tablet earlier this year in part with help from this. The XDA guys will be able to help you with almost any question and issue.

    I have been enjoying it as an ebook reader for many months now. It’s a *tad* slow, but if you keep to reading it shouldn’t matter. The screen is still amazing. I would buy another one if this breaks, few new tablets have the same PPI and small form factor to compete with this.

    Great device worth the effort to bring up to date. PS shoutout to XprivacyLua, I won’t use an android device without it.

  4. Raja Reddy M at | | Reply

    I have installed lineage 17.1 in my nexus 7 flo. It is working good. You may have to use the system partition zip file what you have to do is
    once you are in twrp recovery go to wipe and select advanced wipe. wipe all except internal storage. return back once again to advanced wipe and select system and click on repair in the bottom and observe what is the free space available. comeback to recovery menu and flash system partition zip. You can recheck whether system is re-partitioned or not. If it is not please repeat one more time. Next flash lineage 17.1 zip. Next flash addon su 17.1 then followed by opengapps nano or pico with arm version. Finally flash recent magesik 21.0 zip . Reboot the system.

  5. JWSmythe at | | Reply

    You should look at the scripts “Cross” and “Restock”. They both work for Deb and Flo.

    Cross will install the latest LineageOS. It handles the repartitioning, installing, gapps, root. It’s mostly automated too. You can easily modify it to install any other ROM. The script is pretty easy to read. I think a novice would be ok messing with it.

    Restock will return your tablet to stock, including changing the partitioning, if you changed it.

    But .. it’s not necessary to change the partitioning back. The stock firmware fits fine on the modified partitions.

    I’ve been playing with a stack of Nexus 7 2013 Deb tablets. Tonight, I restocked most of them. It’s like 2 minutes per tablet to restock, and another 7 or so for it to do first boot. I’ve been using LineageOS 17.1 on one constantly for a few weeks now. It works well.

  6. Ann at | | Reply

    Greetings to you…
    came here in google search for info on how secure (or not) to continue using old but working nexus 7 in 2020 for web browsing, gmail & hotmail accounts etc, when the last android security patch was 2016.
    I am not tech savvy, do not have ubuntu; can follow clear instructions though.

    Advice on whether to attempt install of new OS or avoid browsing &/ or mail and just use offline will be greatly appreciated,
    Thanks in advance, Ann

    1. Christian at | | Reply

Please comment with your real name using good manners.

Leave a Reply