Linux Tutorials

How To Install .tar.gz Or .tgz Packages In Linux

Linux is the operating system with more kinds of packages. Surely, if you have used Debian, you should know the file type .deb or maybe, if you have used Fedora, you should know the file type .rpm. In Linux, we have a lot of file types when we talk about installation packages, and surely, you know the format .tar.gz.  

What is .tar.gz or .tgz?

​Tar isn’t an installation package but a computer software utility for collecting many files into one archive file. It is often referred to as a tarball for distribution or backup purposes. So .tar.gz is just a file format.Tar is often used together with a compression method, such as gzip, to create a compressed archive as well as file.tar.gz (or file.tgz).

Tarballs are often used to distribute the source code of an application or maybe a binary file to execute a program. You should consider finding an alternative before installing a tar.gz package because sometimes the process is bit long and tougher.

If you need to install a .tgz package, don’t worry, we have the solution and you’re going to know it through an example:

I need to use WaoN because I play the guitar and I want to transcribe the audio to a midi file, but WaoN isn’t available for my distro. So, I have downloaded the source code to my computer and I have extracted the tarball’s content.

extract tar.gz or tgz file in linux

​To extract the files of a tarball you can use the command: tar xvf tarball.tar.gzAlso, you should find more information about Tar here.

Now, enter into the extracted directory:

cd into the tar extracted directory

​Commonly, the tar.gz package contains a file with the instructions to compile and execute the program. My package contains a file called ‘INSTALL’ with the instructions:

read text file using cat command

​In other cases, you’ll find a ‘configure’ script. This script is a tool to check if your system has all the dependencies required for the building. If you find a ‘configure’ script you must execute it: ./configure (also you should check the file permissions).

If the output of the ‘configure’ script doesn’t report any problem, you can continue with the next step.

configure tar.gz program in linux

​To build a package you must use the program make: make -arguments More about make here.

Finally, I get an executable file:

install executable file in linux
compile tar.tgz package in linux

​Now I must execute my program. In most cases you’ll install the program in your computer, so you must use the command ‘make install’.Another tarball packages contain a binary file, for example:

Sublime Text is available for Ubuntu, but it doesn’t provide a version for my distro, so, I have to use the tarball version (the file type isn’t tgz, it’s a tar.bz2 file).

check tarball file in linux

​It takes the same process, extracts the file.

extract tar file in linux

I found the executable file of sublime text but I checked the file permissions to execute the file. If your file doesn’t have permissions you can modify the permissions using chmod

sublime text editor in linux

​Finally, execute the program. There many possibilities when you install a tarball package. So you must analyze your situation and install your package; it’s easy, just pay attention to your package. Also, when you use .configure command, if you have any dependencies issue, you’ll be asked to install the dependencies. That’s all there is to install .tar.gz or .tgz files in Linux. If you have any problem installing the packages through this method, let me know in the comment section below. I’ll help you out.



LinuxAndUbuntu hosting is sponsored by massiveGRID

1 comment

Tom September 22, 2020 at 9:09 pm

I need some help/clarification.

I am trying to extract file “sqlitestudio-32.1.tar.xz

and I tried your example “tar xvf sqlitestudio-3.2.1.tar.xz”

I get error messages:

Cannot create symlink to ‘libQt55script.so.5.10.0’ : Permission denied

and, there are many more error lines that followed this one.

Thoughts?

Tom

Reply

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This website uses cookies to improve your experience. We'll assume you're ok with this. Thank you! Ok Read More