How to install tar.gz in Ubuntu: using terminal

How to install tar.gz in Ubuntu: using terminal

Linux systems use a variety of file formats, and each format can experience various issues. Tar.gz files are among the most troublesome file formats and often create installation issues for users. If you are currently struggling to get tar.gz files onto your system, here are a few techniques and commands that can help you through the installation process and Install tar.gz Ubuntu using the terminal.

How to install Tar.gz files on Ubuntu?

The first method we recommend is to install the file through your user directory. To do this follow these steps:

  • Open your directory, and go to your file, and use:
$tar -zxvf program.tar.gz 

(to extract .tar.gz files, or)

$tar -zjvf program.tar.bz2

(to extract .tarbz2s.)

  • Next, change the directory to an unzipped folder:
cd /download/program/     
./configure     
  • Next, type:
sudo su
  • To get into the root, enter your password, followed by:
make install

Do not forget to also download dependencies.

How to use a Sudo command to install a Tar.gz file?

  • Alternatively, you can choose to use a sudo command to unzip and install your file. To do this, launch your terminal and enter:
tar -xzf archive.tar.gz
  • Or double-click the archive file and view its contents. If the archive contains some sort of installation software, you will need to execute a sudo command. Be sure to follow the instructions listed in the archive to ensure that the software is properly installed. Here's an example of the command:
tar -xzf archive-name.tar.gz
cd archive-name
./configure
make
sudo make install

Need more help with Linux? Check out our Forum!