Posted: . At: 11:49 PM. This was 11 years ago. Post ID: 5455
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.

How to install a program in Linux that comes as a tar.gz file.

Sometimes you will encounter a program that you have downloaded that comes as a compressed tar.gz file. This is a tar file that is compressed with the gzip program to compress the contents. This usually contains C or C++ source code and the requirements to easily compile the program.

Firstly you need to unpack the contents of the tar.gz file.

Homer@bejiitas ~/Documents$ tar -xvf xterm.tar.gz

Then enter the source folder.

Homer@bejiitas ~/Documents $ cd xterm-291/

Then you need to run the ./configure script to check all of the dependencies of the program you are attempting to compile.

Homer@bejiitas ~/Documents/xterm-291 $ ./configure

If you attempt to run the make command without the ./configure script completing properly then you will get this error.

Homer@bejiitas ~/Documents/xterm-291 $ make
make: *** No targets specified and no makefile found.  Stop.

Otherwise; if the ./configure script has run without any errors then run the make command to compile the source code. Once the compilation process has completed, run the sudo make install command to install the source code. By default, the compiled binaries will be installed to /usr/local/bin. You can change this by using this parameter to the ./configure script.

Homer@bejiitas ~/Documents/xterm-291 $ ./configure --prefix=/usr

This allows you to install the program to the /usr/bin folder instead. Now you may run your installed program. This method of installing software has been around for a very long time and it is very easy if the dependencies are all taken care of.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.