How to Install tar.gz File on Linux Mint 21 – LinuxWays
In the Linux operating system, the tar.gz file is a compressed/zip archive file in which numerous files and directories are combined into a single zip file. The “tar” stands for “tape archive” and “gz” specifies that the file is compressed through GZIP compression format. The tar.gz format reduces the file size and makes it easier for users to save and send files easily.
Many software packages are available in the “tar.gz” source file format because it enables developers to package their software along with all dependencies into a single compressed file. It provides a convenient and efficient way to compress multiple files and distribute them, which users can install on various Linux distributions including Linux Mint.
Quick Outline
How to Install tar.gz File on Linux Mint 21
To install the tar.gz file on the Linux Mint system, download the tar.gz source code file of the required software. Then, it is required to extract its content, configure and compile it. Finally, you can install it using the “sudo make install” command.
For the practical demonstration, go through the following instructions to install the tar.gz file on Linux Mint:
Step 1: Update System Packages
First, update and upgrade the Linux Mint packages list via the given command:
sudo apt update;sudo apt upgrade -y
By doing so, all the system’s packages have been refreshed:
Step 2: Install Required Dependencies
Then, utilize the “sudo apt install” command to install the necessary tools or dependencies required for the source code (tar.gz) file’s extraction and installation:
sudo apt install gzip tar pkg-config build-essential libz-dev libtool automake autopoint gettext -y
Step 3: Enable “Source code repositories”
Next, you have to enable the source code repositories on your system that will allow you to modify and contribute to the various software packages. To do so, open the “Software Sources” from the Menu:
Enable the below-highlighted “Source code repositories” to access the source code of the desired software and hit the “OK” button:
By doing so, the repository’s cache will start updating:
Step 4: Download tar.gz File
Now, download the tar.gz source code file of the required software from the official or trusted source website, using the web browser or “wget” or “curl” commands. Here, we are downloading the Git source code tar.gz file:
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.43.0.tar.gz
Note: You must visit the Git website to check and download its latest version.
It can be observed that Git’s tar.gz source code file has been downloaded successfully:
Step 5: Extract Compressed tar.gz File
After that, extract/unzip the downloaded compressed tar.gz file using the “tar” command along with the file name. You can also extract it into the specific directory or with the specific output file name. Here, we are simply extracting it in the current “Downloads” directory:
tar -xvzf git-2.43.0.tar.gz
Here, “x” represents the extraction, “v” denotes the details of extraction, “f” specifies the file name that is being extracted, and “z” represents that the file is in zipped format.
Upon doing so, the tar.gz file has been extracted successfully as seen below:
Step 6: Redirect to Extracted Directory
Utilize the “cd” command and navigate to the extracted directory i.e. “git-2.43.0” for further configuration and installation:
Note: You can also check for the installation instructions in the “INSTALL” or “README” files in the extracted directory. These files include the specific steps for installing software provided by software developers. You can read these files using the “cat” command.
Step 7: Start Configuration Process
In the extracted directory, type out the below-listed command to initiate/start the configuration process. It will check the system for necessary dependencies and create the “makefile” to compile and install Git’s source code:
Step 8: Compile Source Code
To compile the source code of Git into the executable files, run the below-listed command:
Note: You can also use the “-j” flag along with an integer in the “make” command to optimize the file-building process. For instance, the “-j4” option will utilize 4 threads for parallel compilation and minimize compilation time.
Step 9: Install Git on the System
Once you are done with the compilation process, execute the “make install” command as root/sudo privileges to install the Git software on the Linux Mint system:
Step 10: Verify Installation
Finally, check the software version that is installed from the source code (tar.gz) file to ensure that it is installed on the system:
As you can see, Git has been successfully installed on the Linux Mint system from the source code:
How to Uninstall tar.gz File on Linux Mint 21
You may want to uninstall the software that was installed from the source code/tar.gz file. To uninstall or remove it, simply navigate to the directory where you have installed it on your system and execute the “sudo make uninstall” command. This command reverses the installation process and removes the software from the system.
However, some source code files do not have an uninstallation script, which means that you cannot uninstall the software that was installed through the source code using the “sudo make uninstall” command. If the source code’s uninstallation script is not available, you will get an error while executing the removal command as seen below:
In such cases, you will have to manually remove the software from your system. For instance, we are uninstalling Git from the system using the given command:
sudo find /usr/local -depth -iname ‘git*’ -exec rm -rf {} ;
Here, the “find” command locates the “git” related files in the “/usr/local” directory with a depth-first search. Then, “-exec rm -rf” removes each found file recursively and forcefully.
Note: Before executing this command, make sure that you are in the right directory because the “rm -rf” command directly deletes files and directories without any confirmation.
To verify whether the Git software has been removed from the system or not, check its version:
According to the below output, Git has been successfully uninstalled from the system:
That was all about installing and uninstalling tar.gz files on Linux Mint.
Conclusion
The tar.gz file is a zip file that is available for various software packages. It’s primarily used for compressing numerous files into a single zip file. It can contain text files, scripts, Debian packages, and AppImages files. If you need to install the tar.gz file on your Linux Mint system, download the source code file of the required software. Then, extract its content, configure, and compile it, and install the software. This guide has illustrated the detailed procedure to install and uninstall the tar.gz file in Linux Mint.
I am a technical writer with a knack for learning and exploring new technologies. As a Computer Science Graduate, my expertise lies in the fundamentals of Programming languages and Linux OS. I strive to provide users with in-depth and informative articles that can help them understand the core concepts of modern technologies.