Install ADB and Fastboot on Ubuntu

Fastboot is a tool that can be used to re-flash partitions on your Android device. Useful for the installation of new custom recovery (e.g. twrp) and operating systems like Cyanogenmod on preloaded Android. 


Installation of ADB and Fastboot
Open Terminal and apply following commands,

sudo su
apt-get install android-tools-adb android-tools-fastboot

Plugin mobile phone with PC and can apply various commands to manage your phone.

Fastboot commands

Check mobile phone recognised

fastboot devices

Reboot the device into fastboot

adb reboot bootloader

Flash recovery (e.g. twrp) onto your device
Place recovery image in home folder.

fastboot flash recovery recovery.img
Restart mobile


  1. it shows unable to locate package

  2. it shows "E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
    E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?".......what to do

    1. Please check