How To Install Tar.Gz or Tar.Bz2 Application Source Code?

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/install-tar-gz-tar-bz2-application-source-code/
PINTEREST
PINTEREST
INSTAGRAM

As a systems administrator I generally use package managers to install software. But in some situations I can not use package manager because provided software version is old or do not compatible. In this situations how can I install new software from source code by compiling.

Software source code can be get in different forms like compressed files like tar.bz2 , tar.gz or from repositories like git , svn etc. We will follow compressed way in this tutorial. To get more information about git read following tutorial.

Git Tutorial

Download Source Code with wget

As stated previously we will get source code with the tool named wget .We will provide the url of the compressed source code. To get more information about wget look following tutorial.

Wget Command Tutorial With Examples For Linux

Extract Source Code with tar

Downloaded source code is compressed with tar.gz we will extract it with tar command like below.

Install Compiler and Required Libraries

Before compiling the source code we need to install related compilers and required libraries. More information about the required libraries can be found in the README file of the source code. In this step we will install gcc .

Configure

Professional projects generally have configure script. configure script is used to te setup related files and folders before compiling. configure gets information about the current system and compiler with libraries and created Makefile .

LEARN MORE  Clone Windows and Linux Drives with Clonezilla

Compile with Make

Now the most important part we will compile the source code. Make is very useful tool to compile the source code according to provided configuration. there is very complex compile configurations where they are easily handled by make command. We will just issue make like below. make should be run in source code root directory.

Make Compile Faster

Modern computers have more than single CPU core. If we do not provide any option the make command will compile the source code only using single core. We can use other cores during compile with -j option. This will use given number of cores. In this example we want to use 4 cores.

Install with Make Install

Last step is installing the compiled binaries. We will use make install command. If the binaries will be copied to the directories those we do not have write right we should use with sudo command.

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/install-tar-gz-tar-bz2-application-source-code/
PINTEREST
PINTEREST
INSTAGRAM

Leave a Reply

Your email address will not be published.