How To Compile And Install From Source In Ubuntu

Linux is great for compiling certain software and also you can change them on how they work and also recompile them to see how the program or application worked out.

Ubuntu and other linux operating systems have many package repositories which you can use directly without any change or modifications but in some instances there are certain programs or application which doesn’t have a repository code because either a new version was released or it’s an obscure program.

Compile And Install From Source In Ubuntu

So in such cases you need to build from a source and we have prepared a guide for you which will make you familiar with the basics of programming so that you can start building the program source like a pro.

Installing Required Software’s

  1. Install the build essential package in Ubuntu by entering the following command in the terminal window sudo apt-get install build-essential
  2. Type Y and then press enter to confirm installation when prompted

 How To Get A Source Package

  1. You need the application source package which is usually available in the formats .tar.gz or .tar.bz2 file extensions
  2. As an example lets try compiling pidgin from source so visit the website and download the latest source code which hasn’t been packaged yet
  3. After download is complete you need to extract the .tar.gz file so enter the following command in the terminal window tar -xzvf file.tar.gz and to extract .tar.bz2 file enter the following command tar -xjvf file.tar.bz2
  4. After the extraction is complete the directory will be named same as source code package so enter it using the cd command

How To Resolve Dependencies

  1. After entering the directory run the following command ./configure
  2. This command will check your system to see if you have the necessary software for building this program
  3. If you don’t have the necessary tool installed then you will get an error message so to install the necessary software use the following command sudo apt-get install intltool
  4. After the tool is installed then run the ./configure command again
  5. After the ./configure complete successfully you need to compile and install the package

How to Compile And Install

  1. Use the command to compile the program make
  2. The process of compiling the program will take some time but it mostly depends on the configuration of your system. As the program compiles you will see lines of texts scroll by
  3. Once the program has finished compiling you need to install the program so use the following command sudo make install
  4. The program will be installed in your local directory so to launch the program just type the name of the program and it will launch.
  5. If you want to uninstall the program then enter the following command in the terminal window sudo make uninstall

We hope that the guide has been helpful to you and now that you are able to compile your own programs without any fear or confusion. Linux has lots of tricks which we hopefully will cover in our coming posts. So stay tuned.

(Visited 96 times, 19 visits today)

Speak Your Mind