Installing packages on Ubuntu without admin rights

Sometimes you may work on a remote machine and you don't have sudo permissions to install software you like. If the system administrator cannot add you to the sudoers file due to the strict security policy, then you will need to find a way to install your package. It happened to me on Ubuntu 16.04 with the graphviz package and usual

did not work.

The solution here is to create a fake root environment with the whole system directory structure, download your *.deb packages with all dependencies, extract them to the fake root and use the LD_LIBRARY_PATH trick to make the dynamic linker/loader (ld-linux.so) load the packages and allow execution of the program. Inspiration was taken from chroot, Python virtual environment and famous LD_PRELOAD trick.

The first step would be to find all package dependencies. They are available on the Ubuntu 16.04's website: https://launchpad.net/ubuntu/xenial/amd64/graphviz/2.38.0-12ubuntu2

Here is the script which does the installation of graphviz and tests its dot program:

Exporting PATH and LD_LIBRARY_PATH environmental variables to the .bashrc file would allow to permanently allow execution of the graphviz's dot program.