[HOWTO]Unlock, Root, and install CWR Galaxy Nexus with Ubuntu Linux or Linux Mint 12

Search This thread

loveubuntu

Senior Member
Nov 25, 2010
508
179
warnning: any damage you do to your phone following these directions is your responsibility. Assume you warranty is void if your are rooted.

I used the information koush provided here and info birdman provided here and adopted it in Ubutnu Linux 11.10. I hit some bumps along the way using my Linux box so I decided to write this for those of us not using OS's made by the darkside ;) This should also work with Ubuntu 12.04 LTS just fine.

All this should work with Linux Mint 12 also.

1- Set up Android SDK, adb, and fastboot in Ubuntu Linux using the links in my signature. I can't stress how useful and easy it is to set adb and fastboot in your "path" so you can easily use it from any prompt. The links explain it. Take your time with that and it will payoff for all your devices. Here is the guide I wrote http://xdaforums.com/showpost.php?p=19446284&postcount=62

STOP NOW! EVERYTHING INCLUDING YOUR PERSONAL FILES, PICTURES, AND VIDEOS WILL BE ERASED WHEN YOU UNLOCK/ROOT THIS DEVICE. It does not have a physical SD card. Very annoying. Use Dropbox or Google+ to backup everything.

2- on your phone, go to settings/Developer Options and check the box for USB Debugging

3-connect your phone, fire up a terminal, and type:

Code:
adb devices

You should get the serial number of your device appear. If not, unplug, reboot phone, re-attach the phone to your computer and try again. If you still do not get your device's serial number, go back to step 1 and make sure everything is setup correctly.

4- Now download Clockwork Recovery from here
http://download.clockworkmod.com/recoveries/recovery-clockwork-5.5.0.4-toro.img

(make sure it's the CDMA one (toro). The GSM one is called maguro and steps should be the same)

and su.zip from here

http://download.clockworkmod.com/test/su.zip


5-Turn the phone off, hold both Volume up and Volume Down and press the power button. You should come to a screen that has a big arrow and some writings at the bottom (fastboot). Last line should say Locked state.

6- Connect your phone to your computer, fire up a terminal and type:

Code:
fastboot devices

your phone and its serial number should appear just as it did using adb above. adb will not work here of course. If you don't see your device, go to step one. I guess you can download the fastboot for linux and cd to that directory and do it but I like to have it setup on my computer.

STOP NOW! EVERYTHING INCLUDING YOUR PERSONAL FILES, PICTURES, AND VIDEOS WILL BE ERASED WHEN YOU UNLOCK/ROOT THIS DEVICE. It does not have a physical SD card. Very annoying. Use Dropbox or Google+ to backup everything.


7- Now for the stuff that voids your warranty: Type

Code:
fastboot oem unlock

and enter. Look at your phone now, use the Volume up to choose YES and press the power button to accept. It should say that you are unlocked and fastboot is in good state.

9-use the volume up to change the value appearing in the arrow to recovery and press the power button to accept. You are taken to laying down android with a red triangle. This is the stock recovery. Now carefully press the volume up, volume down, and the power button to get to a menu. Choose wipe data and factory reset. 2 things: I had a hard time getting to the menu. Do it a few times and try pressing the power button JUST a fraction of a second earlier than the 2 volume buttons. Also wiping and resetting takes a few minutes, be patient.

10-you are now unlocked. Turn the phone off ( I pulled battery), go to fastboot screen by holding volume up, down and power button. Connect your phone to your computer and make sure it is recognized by typing:

Code:
fastboot devices

If it is, change directory to where you downloaded clockwork recovery. If you didn't change it, it should be the Download directory (remember it's case sensitive):

Code:
cd Downloads

11- Time to re-write your recovery:

Code:
fastboot flash recovery recovery-clockwork-5.5.0.4-toro.img

Please make sure you use common sense here when it comes to file names. If the file you downloaded has a different name or version, change it in the code above. I guess you can put the fastboot file in that location also to be used if you do not have it setup as in step 1. I'm not positive how and if that would work. Downloading and installing the wrong file is a mistake that may cause harm to your phone.



12- Use the vol up/down to point the big arrow toward recovery, push the power button to get to Cloclwork Recovery. Once you confirm you have CWR, reboot the phone normally and let Android OS create all the folders it needs. Once at start up screen, pull the battery to turn phone off, and then get to bootloader by holding vol up/down and power button in. Use the vol up/down to point the big arrow on sceen toward recovery. While in recovery, make sure your terminal prompt still shows the Downloads directory (or where the su and recovery files were downloaded to). Now type: (note the space between zip and /data)

Code:
adb push su.zip /data/media

this will put the su.zip file in the root of your virtual sd card.

You are still in recovery, reboot into recovery to refresh the file list by typing this

Code:
adb reboot recovery

Now go ahead and install su.zip through clockwork recovery's menus. Pretty self explanatory (choose zip from sd card). The su.zip should be now in the root of your virtual sd card.

That's all. You are now unlocked and rooted. Reboot. Make sure you install the paid versions of rom manager, titanium backup, and update superuser app.

13- Download Rom Manager and flash the recovery again (top choice). This will erase the install-recovery.sh file and keeps your CWR at each boot. You do not have to do step 14 if you do this. I will leave step 14 here just in case someone needs it.


14-When you are back in the fastboot screen. DO NOT reboot the phone here. There maybe a file that re-writes the recovery to stock if the phone is rebooted. Your phone may or may not have this file. of the two GN I have, one did and one did not at this step(may have been erased). The file is reovery.sh and is located in /system/etc/ . You need to either rename it or delete it.

While in fastboot and after you flashed CWR, use the Volume up and Down to change the arrow's value to recovery and press the power button. You should now see the familiar Clockwork recovery. In recovery, you can use adb (you can't in fastboot of course). You need to rename that file, use these steps in terminal: (If you see no file/folder found message, you know you do not have this file)

Code:
adb shell
Code:
mount -o rw,remount /system
Code:
mv /system/etc/install-recovery.sh /system/etc/install-recovery.bak
step 1 fires up adb, step 2 allows you to change permissions and read and write, and step 3 renames it. You can now unplug the phone.

Again, you can also get rid of this file by flashing the clcokwork recovery in Rom Manager or using the paid app root explorer to rename the file.



Once again referrence links:

http://rootzwiki.com/topic/12013-welcome-to-rootzwiki-editionstep-by-step-oem-unlock-and-root/

https://plus.google.com/103583939320326217147/posts/1Jsh9xPwnQP
 
Last edited:

frostthejack

Senior Member
Oct 17, 2010
50
3
thank you so much this is exactly what i was looking for. cant believe im the only one to comment on this. it is very detailed even some one new to Ubuntu could figure this out.
 

kwoolf1

Member
Aug 2, 2008
12
7
I've been using it too for a while but never posted so THANK YOU! Very easy to follow. Great work.
 

ual4720

Senior Member
Jan 6, 2011
73
42
I find I need to run fastboot commands with sudo or su into root before it will work. Same for you, or misconfig on my side?

Sent from my Galaxy Nexus using XDA
 

loveubuntu

Senior Member
Nov 25, 2010
508
179
I find I need to run fastboot commands with sudo or su into root before it will work. Same for you, or misconfig on my side?

Sent from my Galaxy Nexus using XDA

I'm not sure. How did you setup your adb and fastboot? I did not have to sudo for fastboot commands. What OS are you running?
 

AndroidSparty

Member
Apr 29, 2012
37
1
Detroit
Hey loveubuntu, I have a question.

I'm at Step 12, and I'm in recovery and when I run adb push su.zip /data/media, it isn't finding any devices. When I run adb devices, the device isn't listed.

Any advice?
 

loveubuntu

Senior Member
Nov 25, 2010
508
179
Hey loveubuntu, I have a question.

I'm at Step 12, and I'm in recovery and when I run adb push su.zip /data/media, it isn't finding any devices. When I run adb devices, the device isn't listed.

Any advice?

were you able to see the device in the previous steps 3, 6 and 10 and now you don't?

Things that come to mind is:

1- Do you have the usb debugging checked?
2- unplug and replug the device and see if it works.
3- don't forget the samsung recovery file install-recovery.sh. If the phone is rebooted you may have re-written your recovery and have to start over. Then reboot the phone and go to rom manager and reflash the recovery (first option). This will take care of the install-recovery.sh file.
 

AndroidSparty

Member
Apr 29, 2012
37
1
Detroit
were you able to see the device in the previous steps 3, 6 and 10 and now you don't?

Things that come to mind is:

1- Do you have the usb debugging checked?
2- unplug and replug the device and see if it works.
3- don't forget the samsung recovery file install-recovery.sh. If the phone is rebooted you may have re-written your recovery and have to start over. Then reboot the phone and go to rom manager and reflash the recovery (first option). This will take care of the install-recovery.sh file.

3, 6, & 9...check.

I rebooted my phone by pulling the battery and I still can't get adb to see the device. The install-recovery.sh? I don't remember reading anything about that.

In step 12 it says to let the phone reboot into the Android OS, but it's now back at factory reset, as that's what we did earlier in the instructions. As soon as it boots into the Android OS, adb lists the device.

At that point, since I'm in the AOS, I downloaded Astro File Manager and tried to put su.zip in the /cache folder, I think that's the folder that the clockwork recovery mod folder sees, and I don't have permission. I was hoping I could cheat and just drag & drop instead of pushing it. BUT...I did try the command adb push su.zip /media/play and I get permission denied. I'm guessing I don't have permission, even as sudo, to move the file to /data/media.
 

AndroidSparty

Member
Apr 29, 2012
37
1
Detroit
Okay I finally got it!

I didn't wait long enough for the Android OS to boot up. I finally was able to move the .zip file, but I couldn't find where /data/media was. So I let the OS boot up, removed the battery, went back into recovery, moved the zip file, and it was finally listed. :)
 

2LoT

Senior Member
Aug 21, 2012
365
73
Toronto
Thank you for this guide. Some how I like the Linux method better than the Windows ones.

12- Use the vol up/down to point the big arrow toward recovery, push the power button to get to Cloclwork Recovery. Once you confirm you have CWR, reboot the phone normally and let Android OS create all the folders it needs. Once at start up screen, pull the battery to turn phone off, and then get to bootloader by holding vol up/down and power button in. Use the vol up/down to point the big arrow on sceen toward recovery. While in recovery, make sure your terminal prompt still shows the Downloads directory (or where the su and recovery files were downloaded to). Now type: (note the space between zip and /data)

This step is confusing. While in recovery should be replaced by "Hit Power button to enter ClockworkMod Recovery"
Otherwise people may mis-interpret by "Stay in fastboot and position the big arrow on top to Recovery Mode"

In my case (GNex GSM stock JB 4.11):
adb push su.zip /data/media
or
adb push su.zip /sdcard

did copy su.zip successfully but could not be listed by ClockworkMod Recovery menu when selecting "choose zip from sd card". I had to do this:
Code:
adb push su.zip /sdcard/Alarms
And, within the ClockWorkMod Recevery menu, select "choose zip from sd card"
Land on another screen where I could navigate to Alarms folder and see the su.zip there.

Now go ahead and install su.zip through clockwork recovery's menus. Pretty self explanatory (choose zip from sd card). The su.zip should be now in the root of your virtual sd card.

Sorry for being picky but personally, it is NOT self explanatory for me. I was expecting a menu item in CWM Recovery menu to say "Install su.zip". Actually you must navigate in the file system and select the su.zip yourself. Ok, may be that seems obvious now that I know what to do. But on the moment, I was worried I screwed up something because I needed to do some extra manipulations while you said that should be "self explanatory".

4- Now download Clockwork Recovery from here
You may want to up date the link, ClockWorkMod now has a Recovery program which is touch sensitive:
GSM: http://download2.clockworkmod.com/recoveries/recovery-clockwork-touch-6.0.1.0-maguro.img
Sprint: http://download2.clockworkmod.com/recoveries/recovery-clockwork-touch-6.0.1.0-toroplus.img
VRZ: http://download2.clockworkmod.com/recoveries/recovery-clockwork-touch-6.0.1.0-toro.img
 
Last edited:

2LoT

Senior Member
Aug 21, 2012
365
73
Toronto
Step 12 finishes with
That's all. You are now unlocked and rooted. Reboot. Make sure you install the paid versions of rom manager, titanium backup, and update superuser app.

Therefore what is the need of doing #13 and 14?

Furthermore, Step 13 starts by
13- Download Rom Manager and flash the recovery again (top choice)

What is that top choice? Do you mean restart from the top at step #1? If you need to reflash again CWN, would it be simpler to restart from Step 10 instead of going back to the top?

And BTW, what is the reason to reflash the CWM Recovery again just after you have successfully flashed it at Step 12? Could that be #13 and #14 are some steps of an older guide which no longer apply now but you forgot to remove?

Sorry for the silly question but I am rather lost. After all that hardwork, when I attempt to Update SuperUser, it failed on the line "Gaining root access ..." What is the reason and how to fix that? FOUND ANSWER: the su.zip given in the post is Superuser 3.07 which is outdated, It is probably buggy. Replaced it by SuperSU 0.94 and it works perfect: http://download.chainfire.eu/204/SuperSU/

Thanks
 
Last edited:

mal93

Senior Member
Apr 26, 2010
66
4
Verona
worked like a charm.. if you have problem using fastboot, just cd to the folder with fastboot and run it like this:

Code:
sudo ./fastboot "command"

it will require your password and then work normally, seems like it need super user permissions.

Also for new user: to avoid writing a command or a folder name manually just push the TAB button, it will autocomplete the word if it's unique in that folder
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 15
    warnning: any damage you do to your phone following these directions is your responsibility. Assume you warranty is void if your are rooted.

    I used the information koush provided here and info birdman provided here and adopted it in Ubutnu Linux 11.10. I hit some bumps along the way using my Linux box so I decided to write this for those of us not using OS's made by the darkside ;) This should also work with Ubuntu 12.04 LTS just fine.

    All this should work with Linux Mint 12 also.

    1- Set up Android SDK, adb, and fastboot in Ubuntu Linux using the links in my signature. I can't stress how useful and easy it is to set adb and fastboot in your "path" so you can easily use it from any prompt. The links explain it. Take your time with that and it will payoff for all your devices. Here is the guide I wrote http://xdaforums.com/showpost.php?p=19446284&postcount=62

    STOP NOW! EVERYTHING INCLUDING YOUR PERSONAL FILES, PICTURES, AND VIDEOS WILL BE ERASED WHEN YOU UNLOCK/ROOT THIS DEVICE. It does not have a physical SD card. Very annoying. Use Dropbox or Google+ to backup everything.

    2- on your phone, go to settings/Developer Options and check the box for USB Debugging

    3-connect your phone, fire up a terminal, and type:

    Code:
    adb devices

    You should get the serial number of your device appear. If not, unplug, reboot phone, re-attach the phone to your computer and try again. If you still do not get your device's serial number, go back to step 1 and make sure everything is setup correctly.

    4- Now download Clockwork Recovery from here
    http://download.clockworkmod.com/recoveries/recovery-clockwork-5.5.0.4-toro.img

    (make sure it's the CDMA one (toro). The GSM one is called maguro and steps should be the same)

    and su.zip from here

    http://download.clockworkmod.com/test/su.zip


    5-Turn the phone off, hold both Volume up and Volume Down and press the power button. You should come to a screen that has a big arrow and some writings at the bottom (fastboot). Last line should say Locked state.

    6- Connect your phone to your computer, fire up a terminal and type:

    Code:
    fastboot devices

    your phone and its serial number should appear just as it did using adb above. adb will not work here of course. If you don't see your device, go to step one. I guess you can download the fastboot for linux and cd to that directory and do it but I like to have it setup on my computer.

    STOP NOW! EVERYTHING INCLUDING YOUR PERSONAL FILES, PICTURES, AND VIDEOS WILL BE ERASED WHEN YOU UNLOCK/ROOT THIS DEVICE. It does not have a physical SD card. Very annoying. Use Dropbox or Google+ to backup everything.


    7- Now for the stuff that voids your warranty: Type

    Code:
    fastboot oem unlock

    and enter. Look at your phone now, use the Volume up to choose YES and press the power button to accept. It should say that you are unlocked and fastboot is in good state.

    9-use the volume up to change the value appearing in the arrow to recovery and press the power button to accept. You are taken to laying down android with a red triangle. This is the stock recovery. Now carefully press the volume up, volume down, and the power button to get to a menu. Choose wipe data and factory reset. 2 things: I had a hard time getting to the menu. Do it a few times and try pressing the power button JUST a fraction of a second earlier than the 2 volume buttons. Also wiping and resetting takes a few minutes, be patient.

    10-you are now unlocked. Turn the phone off ( I pulled battery), go to fastboot screen by holding volume up, down and power button. Connect your phone to your computer and make sure it is recognized by typing:

    Code:
    fastboot devices

    If it is, change directory to where you downloaded clockwork recovery. If you didn't change it, it should be the Download directory (remember it's case sensitive):

    Code:
    cd Downloads

    11- Time to re-write your recovery:

    Code:
    fastboot flash recovery recovery-clockwork-5.5.0.4-toro.img

    Please make sure you use common sense here when it comes to file names. If the file you downloaded has a different name or version, change it in the code above. I guess you can put the fastboot file in that location also to be used if you do not have it setup as in step 1. I'm not positive how and if that would work. Downloading and installing the wrong file is a mistake that may cause harm to your phone.



    12- Use the vol up/down to point the big arrow toward recovery, push the power button to get to Cloclwork Recovery. Once you confirm you have CWR, reboot the phone normally and let Android OS create all the folders it needs. Once at start up screen, pull the battery to turn phone off, and then get to bootloader by holding vol up/down and power button in. Use the vol up/down to point the big arrow on sceen toward recovery. While in recovery, make sure your terminal prompt still shows the Downloads directory (or where the su and recovery files were downloaded to). Now type: (note the space between zip and /data)

    Code:
    adb push su.zip /data/media

    this will put the su.zip file in the root of your virtual sd card.

    You are still in recovery, reboot into recovery to refresh the file list by typing this

    Code:
    adb reboot recovery

    Now go ahead and install su.zip through clockwork recovery's menus. Pretty self explanatory (choose zip from sd card). The su.zip should be now in the root of your virtual sd card.

    That's all. You are now unlocked and rooted. Reboot. Make sure you install the paid versions of rom manager, titanium backup, and update superuser app.

    13- Download Rom Manager and flash the recovery again (top choice). This will erase the install-recovery.sh file and keeps your CWR at each boot. You do not have to do step 14 if you do this. I will leave step 14 here just in case someone needs it.


    14-When you are back in the fastboot screen. DO NOT reboot the phone here. There maybe a file that re-writes the recovery to stock if the phone is rebooted. Your phone may or may not have this file. of the two GN I have, one did and one did not at this step(may have been erased). The file is reovery.sh and is located in /system/etc/ . You need to either rename it or delete it.

    While in fastboot and after you flashed CWR, use the Volume up and Down to change the arrow's value to recovery and press the power button. You should now see the familiar Clockwork recovery. In recovery, you can use adb (you can't in fastboot of course). You need to rename that file, use these steps in terminal: (If you see no file/folder found message, you know you do not have this file)

    Code:
    adb shell
    Code:
    mount -o rw,remount /system
    Code:
    mv /system/etc/install-recovery.sh /system/etc/install-recovery.bak
    step 1 fires up adb, step 2 allows you to change permissions and read and write, and step 3 renames it. You can now unplug the phone.

    Again, you can also get rid of this file by flashing the clcokwork recovery in Rom Manager or using the paid app root explorer to rename the file.



    Once again referrence links:

    http://rootzwiki.com/topic/12013-welcome-to-rootzwiki-editionstep-by-step-oem-unlock-and-root/

    https://plus.google.com/103583939320326217147/posts/1Jsh9xPwnQP
    4
    you're welcome. I find it ironic that a Linux based OS such as Android has so many HOWTOs for Windows but not enough for Linux. #powerofmonoply