In this article, we will learn how to install softwares in Linux from a tarball. There are many ways for installing a standalone application from a tarball (.tar, tar.gz, tar.xz, .tar.bz2), but this way is the most reliable and safe. For the past 10 years, I am using Linux but if I need to recommend a way to install a standalone application from a tarball to a Linux newbie, I will definitely recommend this way. Later in the article, we will create a symbolic link, so that you can easily run a program with your custom-defined command :). Sounds Interesting !, Let dive in.
Step 1: Download & Extract a tarball
Download a tarball from the source site, for the demonstration we will use the tarball of Firefox developer edition application.
Extract a tarball by using the below command.
tar xvf your_package_name
Now, after extracting you will notice a directory has been created (
firefox in our case).
Step2: Install Softwares in Linux from a tarball
We have an extracted tarball in a directory, you can move this directory to any path of your choice. I generally keep all software in one place - generally in the home inside the Programs directory.
Lets create a directory named
Programs in the home
Since, I have extracted the tarball in the Downloads directory, So first I will move the extracted tarball directory to our newly created Programs directory.
mv firefox ~/Programs
Now, Lets dive in to the extracted tarball directory in our case it is
If you notice above you have an executable file in your extracted tarball directory in our case it is
firefox. That is your standalone software. You can run it by executing the below command.
sudo chmod 755 ~/Programs/firefox/firefox ./firefox
Now your software will be executed.
Now you must be wondering how to execute the same with the single command on Linux like if I type -
firefox-dev on the terminal, it directly executes the firefox developer browser. For making the same happen, the symbolic link will come into the play, If you don't know about the symbolic link you can refer to the below article.
How to create a symbolic link in Linux
Now we will create a symbolic link of
firefox file with
/usr/bin/<command_name>. I want to execute the firefox developer browser with firefox-dev so, I will specify
sudo ln -s ~/Programs/firefox/firefox /usr/bin/firefox-dev
Finally you can now run your standalone applications by simply executing
firefox-dev command on terminal.
Note:- Some executable inside the extracted tarballs requires dependencies. We would recommend you to install the same if you encounter them. Also, Some tarballs have a different structure you can install them by executing these three commands inside your extracted tarball directory.
./configure make sudo make install
That's it, If you have any query please feel free to post in the comment section below.