Install Any Package From Any Release Of Ubuntu Into Any Version Of Ubuntu

Meet ‘Adapt’ that adapts any applications from any Ubuntu release. Adapt is a simple, yet very useful application that can be used to install any package from any release of Ubuntu into any version of Ubuntu without using any PPA. You don’t have to wait for the developers to update their PPA for any particular application. Just install adapt, and start installing the app you want on any Ubuntu version. Not only from Ubuntu, you can run any application from any other Linux distribution, for example CentOS. In layman terms, Adapt is like apt command that allows us to run old software on a newer OS or newer software on an older OS. Sounds awesome? Yes, it is.

Adapt utility is something similar to Linux Containers, but little different. Adapt uses lightweight LXD and Ubuntu system containers to achieve this goal. Here, we refer the containers as adapt container. Whenever you install package, the package will be installed in an adapt container. Similarly, whenever you remove a application, it will be removed from the adapt container. Adapt is developed by Dustin Kirkland from Canonical’s Ubuntu Product and Strategy team. It is mainly developed for Ubuntu systems, However It might work on other Ubuntu derivatives.

Why ‘adapt’?

Sometimes, you need to use or test an updated package from the newer release of Ubuntu or other distro. Of course, the updated packages will be available in Ubuntu Backports repository. Alternatively, you can use the software PPAs to get the updated packages. In case, some of the updated packages are not available in the backports repository and PPA for some reason, ‘adapt’ utility comes in help.

In this brief tutorial, let us see how to install and use adapt in Ubuntu 16.04 LTS desktop.

Install Adapt on Ubuntu

I tested ‘adapt’ in Ubuntu 14.04 LTS desktop and Ubuntu 16.04 LTS desktop. It worked perfectly.

To add ‘adapt’ PPA, run:

sudo add-apt-repository ppa:adapt/ppa

On Ubuntu 14.04, we must add the following PPA. On Ubuntu 14.10 and later versions, it’s not necessary.

sudo add-apt-repository ppa:ubuntu-lxc/lxd-stable

Update the software repositories using command:

sudo apt-get update

Finally install adapt as shown below.

sudo apt-get install adapt lxd

Usage

Adapt usage is simple and straight forward like ‘apt’ command. Let us see some examples.

Well, now I need to install Nginx software from Ubuntu 14.04 release in the current Ubuntu version (16.04 in our case). How can I do this? Manually download Nginx deb file for trusty version on Xenial. Nope. It is not necessary though.

Here is how adapt method simplifies this task:

sudo adapt install -r trusty -p nginx

Here,

-r : Distribution release name (Trusty, Xenial etc)

-p : Package name

The above command will download the Ubuntu 14.04 LTS container image (We call it as adapt container), and install Nginx in it. Clear?

Similarly, you can remove a software, run.

sudo adapt purge -r trusty -p gcc

Now, you might ask why should we complicate ourselves? You might think that we can simply install lxd in Xenial and pull the distribution of our choice, log in to the container, and finally install the required packages? Of course, we can. But, Adapt simplifies this task much easier, and it does the above whole task in a single command.

Also, you can install higher version software in lower version Ubuntu.

For example, to install a software from higher version (e.g Ubuntu 15.10) in lower version (e.g Ubuntu 14.04 LTS), use the following command:

Conclusion

Adapt is pretty much suitable for developers who wants to adapt a package from a newer version of Ubuntu onto their stable LTS desktop or server. And also, adapt allows the developers to provide the latest releases for testing purposes to the users running an older LTS version of Ubuntu. Since it uses LXD Containers, it is light-weight, and you need not to install any extra Virtualization softwares to test various applications from various distributions.

That’s all for now. Hope this guide will help you. If you find this tutorial useful, share it on your social networks, and support OSTechNix.