Howto compile the Gimp 2.8.6 in Ubuntu

GIMP, one of the greatest open-source apps, recently released version 2.8.6. but there are no ppa with the latest version available just yet. In this tutorial we will compile 2.8.6 from source.

First we will remove previous gimp version otherwise you will get the error below:

Libgimp version mismatch!
The GIMP binary cannot run with a libgimp version
other than its own. This is GIMP 2.8.6, but the
libgimp version is 2.8.4.
Maybe you have GIMP versions in both /usr and /usr/local ?

Remove gimp by running sudo apt-get purge gimp
and sudo apt-get autoremove to remove all now unneeded packages used by gimp.

Dependencies

Now, to compile an application, you need its dependencies - libraries the application requires - because gimp is also in the Ubuntu repositories(Older version of gimp) so are its dependencies. One can install them by invoking the build-dep command in the gnome-terminal like so: sudo apt-get build-dep gimp

GIMP also uses xvfb and it will give a xvfb NO message when done compiling, nothing critical is missing but this is an optional feature. Xvfb is an X11 server that performs all graphical operations in memory, not showing any screen output.
sudo apt-get install xvfb-run

Gimp Plugins

When u have removed gimp*, and compiled it from source, you will see that some plugins are not available. Like one of my favorites the Heal Selection, is not available. Simply sudo apt-get install gimp-plugin-registry did not work for me. To get all of your favorites feature back. Download, the gimp-plugin-registry .deb file. Extract the content from the .deb file, in the directory: gimp-plugin-registry_5.20121030-1ubuntu0ppa9~precise_amd64.deb/usr/lib/gimp/2.0/plug-ins/ and copy it in ~/.gimp-2.8/plug-ins after that, all of your features are returned.