This site is only possible by the contributions of others. It is primarily a generous collection of their knowledge. To obtain even greater information PLEASE visit their sites via the "Posted by" links or the "Places" list on the left. Thank you so much!

Installing Software from Source in Ubuntu

Posted by MoPedia

Have you ever come across software that doesn’t have a deb file or isn’t in any repositories? Well don’t be put off, because compiling and installing from source is pretty straightforward. The software packages will either be in tar.gz or tar.bz2 form. There are essentially four steps you need to take to install your software. For this example I will be using pkg as the package name and me as my username, so just replace these two. Open up your terminal and follow the steps below.

Unpacking
Configuring
Building
Installing

Unpacking
You can download the package to anywhere you want, I’m going to be using /home/me. If your software package ends with .tar.gz use this command:

tar xvzf pkg.tar.gzOr, if it ends in tar.bz2 use this:

tar xvjf pkg.tar.bz2

Now your software is unpacked and is stored in a newly created folder in the same directory you stored the software package e.g /home/me/pkg. We need to cd into that folder using this command:cd pkg

Configuring
The following should work for most cases. if it doesn’t you should consult the README or help file for the correct command../configureHopefully that will configure without any errors so you can move to the next step.

Building
If you have successfully configured it, there should be a MAKEFILE created. You use this file to build using the following command.makeInstalling

Finally use the following to finish installation. You will be prompted for your password.

sudo make installDuring the installation process there are some files created, after installation they are useless and you can safely delete them using this command :make clean

To uninstall you will need the makefile and this command:

make uninstall

Now your software should be installed and ready to use. For a safer way to install from source have a look at checkinstall, which lets you create .deb files from your source packages. This allows you to uninstall using synaptic and is also better for when upgrading to a newer version of Ubuntu.

Leave a Reply