Installing software from the Linux command line is not as daunting as it may seem at first. If you are looking for instructions on how to install a tar.gz file in Linux, you've come to the right place. A tar.gz file is similar to a .zip or .rar file but with a slight difference; tar archives contain both files and directories, whereas .zip and .rar files are limited to just files.
Before we jump into our tutorial, let's quickly identify what a tar.gz file is and clarify why you would want to install it in the first place. A tar.gz file typically contains software that must be compiled before use, such as programs written in C or C++. To install it, all you have to do is run a series of commands which will unpack the contents of the archive and place them into a directory of your choosing.
Ready? Let's jump right in!
Step 1: Locate Your Tar File
In order to begin installing your tar file, you'll need to locate where it is stored. It should either be located within your current directory (the folder you are currently within) or somewhere deeper within your system files (e.g., /home/user/Downloads). To switch between folders, use the "cd" command followed by the name of the directory:
cd Downloads
Step 2: Unzip the Contents
Once you've located your tar file, you can now unpack its contents using the "tar xvfz " command followed by its complete filename:
tar xvfz myprogram-1.0-Linux-x86_64.tar.gz
This will create a folder with all of your new program's files and directories inside of it (allowing them to be properly read by your system). Note that if this program is destined for global use, be sure that you don't forget about any additional root installations necessary beforehand!
Step 3: (Optional) Move & Install Into Your Path Directory
If you want this program installed somewhere other than its current directory simply use "mv" followed by source & destination paths:
mv ./myprogram-1.0-linux x86_64/ /usr/bin/myprogram **OR** mv ./myprogram-1.0-linux x86_64/ /usr/local/*
This will move its contents into either /usr/bin or /usr/local directories respectively, which are used as part of your system's PATH setup so they can accessible from anywhere while keeping everything organized too! However please make sure that these folders exist before running this command - elsewise move them into another more suitable location manually using traditional copy & paste methods instead!
sudo cp -R ./myprogram-1.0-linux x86_64/* /opt/myprogram **OR** sudo cp -R ./myprogram-1.0-linux x86_64/* ~/bin
See more about linux installing tar gz
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.