[Ubuntu]Installing Ubuntu on a phone



Instructions for flashing a phone or tablet device with Ubuntu.

Before you start, please read this

Ubuntu for phones is intended to be used for development and evaluation purposes only. It is an early release that can potentially brick your device. It does not provide all of the features and services of a retail phone and cannot replace your current handset. This is the first release of Ubuntu for phones and it will continue to evolve quickly. Please read the disclaimer as well. This process will delete all data from the device. Restoring Android will not restore this data.

What to expect after installation

After you install Ubuntu for phones, you will have the following functionality:

  1. Shell and core applications
  2. Connection to the GSM network on Galaxy Nexus and Nexus 4
  3. Phone calls and SMS on Galaxy Nexus and Nexus 4
  4. Networking via Wifi
  5. Functional camera, front and back
  6. Device accessible through the Android Developer Bridge tool (adb)

For detailed information check the release notes.

Supported devices and codenames

The table below lists the supported devices and their corresponding factory images, should you want to switch back to Android. The images can be found on the Google developer website.

Factory firmware from Google

Galaxy Nexus

Nexus 4

Flashing the device

  1. 1
    Desktop setup

    The following steps are required on your desktop system in order to flash and communicate with the device.

    Setup the Ubuntu for phones tools PPA

    The PPA has the tools and dependencies to support 12.04 LTS, 12.10, 13.04 and 13.10. Add the Ubuntu for phones PPA by adding the following custom source list entry to your/etc/apt/sources.list file.

    On your computer, press Ctrl+Alt+T to start a terminal.

    sudo add-apt-repository ppa:phablet-team/tools

    Then do the following:

    sudo apt-get update 
    sudo apt-get install phablet-tools android-tools-adb android-tools-fastboot
  2. 2
    Android backup (optional)
    • If not enabled, enable developer mode by tapping Settings > About phone > Build number (7 times)
    • If not enabled, enable USB debugging in Settings > Developer options > USB debugging
    • Execute on your computer
      adb backup -apk -shared -all

    This should hopefully create backup.ab with all of your apps, OS, and data. Later, after reflashing with Android (or rooting / unlocking) you will be able to use

    adb restore backup.ab

    to restore all of your data.

  3. 3
    Device unlock

    If the device is already unlocked, skip to Step 4. These steps will wipe all personal data from the device.

    • With the device powered off, power on the device by holding the power button + volume up + volume down.
    • The device will boot into the bootloader.
    • Plug the device into the computer via the USB cable.
    • On your computer, in a terminal, run sudo fastboot oem unlock, on the device screen, accept the terms of unlocking.
    • Boot the device by pressing the power button (pointed by an arrow with Start on the screen).
    Device factory reset

    If you get stuck in a bootloop rebooting the device after unlocking the bootloader, here is what you do:

    • During the bootloop hold the power button + volume up + volume down button simultaneously to get yourself back into fastboot mode as you were previously.
    • In fastboot mode, use the volume keys to scroll to Recovery and the power button to select it.
    • In Recovery (Android robot on his back with a red triangle), tap the volume up button and the power button simultaneously which will bring you into stock recovery. Don't hold the buttons, just tap them simultaneously.
    • Also make sure you're holding the correct volume button. Up will be the volume key on the right.
    • Once you're in Recovery, perform a factory reset/data wipe and then reboot your device, you should now be back to the Welcome Screen.
  4. 4
    Initial device setup

    Follow these initial steps on your device:

    1. If not booted, boot the device into Android
    2. Enable USB debugging on the device
      • On Ice Cream Sandwich (version 4.0) go to Settings and turn on USB Debugging (Settings > System > Developer options > USB debugging).
      • On Jelly Bean (versions 4.1 and 4.2) you need to enterSettings > About [Phone|Tablet] and tap the Build number 7 times to see the Developer Options.
      • On 4.2.2, (Settings > About) tap on build number 7 times to activate the developer options menu item).
      • On either Android version you must then enable USB debugging via Settings > Developer options > USB debugging. You will also need to accept a host key on the device.
        • On the workstation: adb kill-server; adb start-server
    3. Plug the device into the computer via the USB cable.
      • Depending on the installed Android version, a popup will show up on the device with the host key that needs to be accepted for the device to communicate with the workstation.
      • Note, 'adb devices' should not show the device as 'offline'. If it does, unplug the device, run adb under sudo on the workstation (eg. sudo adb kill-server; sudo adb start-server), then plug the device back in.
    4. Save the version of the current image on the device, if on Android, to use as a reference to revert back to. The version can be found by going to Settings > About Phone > Build Number.
  5. 5
    Downloading and deploying image to device

    To install Ubuntu for phones on your device, you will need to run the command:

    phablet-flash ubuntu-system --no-backup

    Please note, this will wipe the contents of the device so ensure you have made a backup.

    This will deploy the latest build onto your device, after which your device will boot into the Ubuntu Unity shell. This step can take a very long time.

General notes

  • Be patient — some steps, like pushing the files over USB to the device, take time. Just wait through any screens looking like input is required. Carefully read messages on the host and the device.
  • The files are saved in Downloads/phablet-flash.
  • If the deploy fails (for example boots to black screen), try wiping the /data partition on your device and redeploy.
  • phablet-flash will not work unless you have booted your device (it must not be displaying the bootloader screen and "adb devices" should list your device).
  • If you get stuck at ' < waiting for device > ' and your device reboots into Android, you may have to run phablet-flash under sudo

Need help?

If you got lost somewhere, you found a bug or need some help, we're happy to help you. Ubuntu for phones is put together by a community of many, who are eager to work together with you on this.

If you've got any questions with these installation instructions, there's a community willing to help, just ask on Ask Ubuntu!

You can also:


For other examples of things you can do with your phone, like:


Ubuntu for phones is released for free non-commercial use. It is provided without warranty, even the implied warranty of merchantability, satisfaction or fitness for a particular use. See the licence included with each program for details.

Some licences may grant additional rights; this notice shall not limit your rights under each program's licence. Licences for each program are available in the usr/share/doc directory. Source code for Ubuntu can be downloaded from archive.ubuntu.com. Ubuntu, the Ubuntu logo and Canonical are registered trademarks of Canonical Ltd. All other trademarks are the property of their respective owners.

Ubuntu for phones is released for limited use due to the inclusion of binary hardware support files. The original components and licenses can be found on the Google website.

作者: 沐杰