How To Install a Package From .tar.gz Or .tar.bz2 File In Linux?

How To Install a Package From .tar.gz Or .tar.bz2 File In Linux?

 

This post was last updated on August 1st, 2020 at 02:17 pm

A file archiver is used to hold multiple files into a single archive file. And a file compression utility is used to reduce the size of these files. Archiving and compressing files makes file handling easier and faster to transmit over the network or internet.

Linux provides various archiving tools one of them is tar. Also, it provides file compression tools such as gzip, bzip2, xz, lzma, etc. These archiving and compression tools are used together to distribute software packages in Linux.

Generally, this archive contains the source of the package and each of them follows a different approach to install. In this article, we will discuss a command method to install software from .tar.gz or .tar.bz2 package.

How to Extract .tar.gz package

Suppose we have a package named package-1.2.3.tar.gz and we have to install it. To install this package first we need to extract it. Follow the below steps to extract it-

1. Open your terminal by pressing ctrl+alt+t

2. Navigate to the location where package-1.2.3.tar.gz is saved suppose it is in downloads directory then use –

cd Downloads

3. Now run the following command to extract it –

tar xzvf package-1.2.3.tar.gz

Where,

x- Extract

z- Type of compression i.e. gzip

v- Verbose

f- Next comes the filename

How to Extract .tar.bz2 package

Similarly, if you have a package named package.tar.bz2 then to extract it first open your terminal and navigate to the correct directory where the file is located. And then run the following command to extract it.

tar xjvf package-1.2.3.tar.bz2

Where option j is used for bzip2 compression.

Install the extracted package

Now first move to the extracted directory named package-1.2.3

cd package-1.2.3

Make sure to read a file with the name INSTALL.txt or README. You can check these files by using ls command in your terminal. Use the following commands if –

1. You find a file named configure then use –

./configure

If fails to execute provide the executable permission to it with –

chmod +x configure

And the execute

make
sudo make install

You may also need to install some dependencies if, for example, running configure can prompt you with an error listing which dependencies you are missing.

2. And if you find a file named install.sh then use –

./install.sh

or

sudo ./install.sh

3. You find the file named install.sh then use –

./install

or

sudo ./install

4. If there is no configure file then use –

make
sudo make install

5. If you still can’t find the required files for installation then move to a special directory named bin and repeat the same process.

We recommend you read INSTALL.txt or README which contains the complete instruction on how to install the particular package. You should read this because there could be different instructions available for the proper installation of that file.

Now I hope by using the given steps you are able to install the software in your system. Still, if you find a problem while installing the software then don’t forget to write us in the comments below.

Previous What Is A Virtual Terminal In Linux/Unix?
Next How To Run A Process In Background In Linux/Unix?
 

About author

You might also like

Linux Topics 0 Comments

How to Download, Extract and update the Linux Kernel source

When you are starting to learn Linux programming or Device driver development, then the first thing you need is the Linux Kernel which is available in a zipped archive format

FreeBSD Topics 0 Comments

How To Check System Hardware Information In FreeBSD?

This post was last updated on August 1st, 2020 at 10:25 amA computer system is consists of different types of hardware such as processor, RAM, hard disk, network cards, etc.

Linux Topics 0 Comments

How To Install And Configure Fish Shell In Ubuntu 20.04 LTS?

This post was last updated on August 1st, 2020 at 10:33 amIn Unix-like operating systems such as Linux, a shell is a program that interprets the command, executes, takes input(s),

0 Comments

No Comments Yet!

You can be first to comment this post!

Leave a Reply