How to Compile and Install a Linux Software from Source Code
Most often we do install software from the terminal by the help of apt-get, rpm, yum, Ubuntu Software Center (GUI) and other forms on various Linux distributions. Sometimes it is good to download the source code of the software and compile it yourself.
Most Linux newbies find this very difficult, since most of them are likely to have moved from Microsoft Windows OS, where they only surf the web and download executable files. Today we are going to learn how to make this difficult task very easy.
Note: I can say that every geek knows this, so this tutorial is actually for newbies.
First of all, what is source code? From Wikipedia Source Code article:
In computer science, source code is any collection of computer instructions (possibly with comments) written using some human-readable computer language, usually as text.
First download a tarball (a zipped file which contains the source code). You either download directly from the website or from the command. If you don’t know about how to use the terminal to download, you can use:
$ wget URL
Or read the following tutorial Command-Line Downloading Using aria2 on how to use aria2, a command-line downloader.
Note: In this tutorial I am using filename as the name of the tarball I have downloaded.
Now let us extract the downloaded tarball using the terminal. If your tarball ends with,
$ tar -xvpf filename.tar.gz
$ tar -xvjf filename.tar.bz2
Note: Sometimes file names are very long to remember so you can use the ls command to list files for easy typing.
After ther extraction, change your directory to the extracted folder.
$ cd filename
Next run this in the filename directory to configure the package:
Now you run the command below to compile the source code associated with the software package:
Finally, install the software:
$ make install
You have just compiled and install a software from source code.
Like us on Facebook
We need your assistance to stay live
This week Top Posts
- Top Things To Do After Installing Ubuntu 13.10 'Saucy Salamander' : Ubuntu 13.10 Saucy Salamander will be released on coming October 17th with many new salient featur...0 comments |
- Wow! Linux Foundation To Offer Free Linux Course This Summer Worth $2,400 on EdX : Wow! Early last week it was all over the internet, if you haven't heard it yet then this is the t...0 comments |
- Grive: An Unofficial, Open Source Linux Client For Google Drive : A couple of months before, we have featured a Linux client for Google Drive named Syncdrive, which w...0 comments |
- How To Upgrade From Ubuntu 13.04 Raring To Ubuntu 13.10 Saucy Salamander : Ubuntu 13.10 Saucy will be released on October 17th. Hope it will come with lot of improvements and ...0 comments |
- How To "Fix E: Could not open file /var/lib/dpkg/status" : QUESTION: I get the following error when I use sudo apt-get update: E: Could not open file /var/...0 comments |
- Install LAMP Server (Apache, MySQL or MariaDB, PHP) On Ubuntu 13.10 : Updated January 12, 2014 LAMP is a combination of operating system and open-source software stack. ...0 comments |
- Install Sublime Text 3 In Fedora Easily With Fedy
- Grive: An Unofficial, Open Source Linux Client For Google Drive
- Install nSnake Game In Terminal
- How To “Fix E: Could not open file /var/lib/dpkg/status”
- Wow! Linux Foundation To Offer Free Linux Course This Summer Worth $2,400 on EdX
- Fedora 21 Scheduled For Release In October
- Install Uget Download Manager In Ubuntu, Fedora, Debian
- Download Elementary OS ‘Luna’ Official Wallpapers
- Install Power Commands 0.1.5 On Ubuntu 14.04/13.10/12.10/12.04
- 5 Android Apps that’s Going to Make Running Your Business Less Stressful
This work by unixmen.com is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Copyright © 2008-2013 Unixmen.com .