{"id":2222,"date":"2019-02-12T22:07:25","date_gmt":"2019-02-12T19:07:25","guid":{"rendered":"http:\/\/kifarunix.com\/?p=2222"},"modified":"2019-02-12T22:07:25","modified_gmt":"2019-02-12T19:07:25","slug":"how-to-install-programs-from-source-on-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/how-to-install-programs-from-source-on-ubuntu-18-04\/","title":{"rendered":"How to Install Programs from Source on Ubuntu 18.04"},"content":{"rendered":"
In this guide, we are going to learn how to install programs from source on Ubuntu 18.04. More often than not, the easiest and hustle free method of installing programs on Ubuntu 18.04 or the whole Linux family is to use the respective distribution package manager. This ensures that you are installing a software that is optimized for your distribution. It also eliminates the issue of having to deal with annoying dependencies. However, there is a point in time when you need to install the latest version of a software to patch some bug or test a new feature or even a software that is not available on your distribution repositories. In this case, then you need to download the source code of the program, compile and install it.<\/p>\n
Therefore, in this guide, you going to learn how to;<\/p>\n
make<\/code> to compile programs<\/li>\n- Apply parameters to a configure script<\/li>\n
- Know where sources are stored by default<\/li>\n<\/ul>\n
Install Programs from Source on Ubuntu 18.04<\/h2>\n
You first need to download the software tarball from the trusted sources before you can proceed.<\/p>\n
Unpacking the Source Code<\/h2>\n
Opensource software is always distributed as a compressed tarball. The tarball contains the program source code which basically contains all the necessary scripts for compiling and installing the software.<\/p>\n
There are various tools that can be used to compress the source code tarballs. The most common ones include gzip<\/code>, bzip2<\/code>, xz<\/code>. So how do you unpack the tarball that has been compressed using the various formats of the above tools.<\/p>\nUnpacking .tar.gz<\/code> or .tgz<\/code> tarballs<\/h3>\nTo unpack the tar.gz or .tgz, you would use any of the following commands;<\/p>\n
Using gunzip<\/code> or gzip<\/code>.<\/p>\ngunzip -dc tarball.tar.gz | tar xf -\r\ngunzip -dc tarball.tgz | tar xf -<\/code><\/pre>\nUsing tar<\/code> command;<\/p>\ntar xzf tarball.tar.gz\r\ntar xzf tarball.tgz<\/code><\/pre>\nUnpacking .tar.bz2<\/code>,\u00a0.tar.bz<\/code> or .tbz<\/code> tarballs<\/h3>\nUsing bzip2<\/code>, bunzip2<\/code>.<\/p>\nbzip2 -dc tarball.tar.bz2 | tar xvf -\r\nbzip2 -dc tarball.tbz2 | tar xvf -\r\nbzip2 -dc tarball.tbz | tar xvf -<\/code><\/pre>\nUsing tar<\/code> command;<\/p>\ntar xjf tarball.tar.bz2\r\ntar xjf tarball.tbz2\r\ntar xjf tarball.tbz<\/code><\/pre>\nUnpacking .tar.xz<\/code> or .txz<\/code> tarballs<\/h3>\n