How To Install android-headers-22 on Ubuntu 18.04

In this tutorial we learn how to install android-headers-22 on Ubuntu 18.04. android-headers-22 is Android Platform Headers from AOSP releases

Introduction

In this tutorial we learn how to install android-headers-22 on Ubuntu 18.04.

What is android-headers-22

android-headers-22 is:

Android NDK provided by Google contains subset of AOSP platform headers which are deemed “external interface” by Google. However, writing advanced software for Android necessitates access to complete platform. Many aspects of it change, sometimes drastically, between releases, so compiling user source code against platform headers for different releases is required (e.g. for libhybris).

This package provides the platform development headers for core components of AOSP (Android Open Source Project), for the 5.1 release

There are three methods to install android-headers-22 on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install android-headers-22 Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install android-headers-22 using apt-get by running the following command:

sudo apt-get -y install android-headers-22

Install android-headers-22 Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install android-headers-22 using apt by running the following command:

sudo apt -y install android-headers-22

Install android-headers-22 Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install android-headers-22 using aptitude by running the following command:

sudo aptitude -y install android-headers-22

How To Uninstall android-headers-22 on Ubuntu 18.04

To uninstall only the android-headers-22 package we can use the following command:

sudo apt-get remove android-headers-22

Uninstall android-headers-22 And Its Dependencies

To uninstall android-headers-22 and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove android-headers-22

Remove android-headers-22 Configurations and Data

To remove android-headers-22 configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge android-headers-22

Remove android-headers-22 configuration, data, and all of its dependencies

We can use the following command to remove android-headers-22 configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge android-headers-22

References

Summary

In this tutorial we learn how to install android-headers-22 package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.