Tarballs - Please clear this up for me.....

khedger

Active Member
Joined
Jun 7, 2019
Messages
152
Reaction score
85
Credits
1,294
Hi all,
These days I use Ubuntu and Mint, so most of my package management is done through apt. However, in the past, and occasionally still, I need to install via a downloaded tarball. There are a couple of things that have never been clear to me about
this process that I'm hoping some kind soul(s) can clear up. Before I list my questions please know - I understand that there is nothing that dictates that all tarball install processes be the same, however I feel like these question are pertinent for most of the
tarballs that are created these days (obviously I can be corrected on this point too if necessary).
- after checking out the READMEs in the untarred directory, what is the process usually followed to install? (just ./install.sh?)
- if I download a tarball to say, my downloads directory, untar it, then do the install process, will the resultant install files usually be put in the appropriate system directories, or will they be created under my download directory and have to be moved to the appropriate system directories by hand. In other words, can I usually expect to just do the install scripts and then have everything in place or not?

I hope the questions are clear, and please, be gentle =:)

keith
 


It depends on the content of the tarball.

Some are source code and will need to be built manually and installed. Sometimes when building from source, you will need to download and install additional dependencies.
Many require you to run a configuration script, before you can build. You may even have to install a different build system.
Many use GNU auto tools, but some might require something like cmake, or qmake, or ninja, or Apache Ant etc.

Other tarballs might contain pre-built binaries, or binary installers, which may require you to give them execution permissions before you can run them.

Or it might just require running a shellscript. Or if it is a python based package, you might have to run a setup.py script in python.

So, the action required depends entirely on the content of the tarball in question. Read through any instructions packaged with the tarball.
 
You will need to unzip the tarball with something like xarchiver and has been said above additional dependencies may be required. You need to cd into the directory where the make and install and instructions are.........

Working example download Deadbeef sourcecode as tarball - unzip with xarchiver.......
I unzipped to Downloads folder so in my case in a root terminal (su or sudo and password) I type in my case cd /home/darry1966/Downloads/deadbeef-1.8.4 and hit enter I am then in that working directory. In my file manager I go to that directory and read the help files like and follow those instructions and type commands in terminal as instructed. Puppy users will require a devx for that Puppy to do any compiling from source.
 
So, yes, it depends. There are very few standards that apply to the use of tarballs for installing software - or anything. The number one standard is to read, understand, and follow the instructions that come with your power tools (thank you Norm Abram) as well as with your tarball. The second standard is that it's all a matter of reading the originator's intructions, because no one answer in one forum is going to do anything but leave out the one important condition that came with your tarball. So I will say, without having to rationalize my answer, always RTFM.
 
rtfm....thats the same as "read the f destructions".....
 
Hmmm...thank you for your answers. I'll just point out that I DID state in my original messate that "I understand that there is nothing that dictates that all tarball install processes be the same" and so I guess you've all confirmed that for me. Thing is, I've downloaded MANY installation tarballs that contain a README that says something like:
run configure.sh
run install.sh
That's it. Nothing about WHERE the stuff is going to be installed, etc. So I get you, RTFM, I always do. I guess if it's not in the REAME one is just expected to let fly and see where things end up?

keith
 
It's another aspect of the "freedom" of Linux. Freedom from providing useful information :D
 
Hmmm...thank you for your answers. I'll just point out that I DID state in my original messate that "I understand that there is nothing that dictates that all tarball install processes be the same" and so I guess you've all confirmed that for me. Thing is, I've downloaded MANY installation tarballs that contain a README that says something like:
run configure.sh
run install.sh
That's it. Nothing about WHERE the stuff is going to be installed, etc. So I get you, RTFM, I always do. I guess if it's not in the REAME one is just expected to let fly and see where things end up?

keith
Most of the tar balls that I have installed ended up installed in /usr/bin/.
 
Regarding locations - again - it depends on the content. Typically ones that use the gnu make build system will allow you to specify the installation prefix directory, stored in a variable called $PREFIX.

Usually it’s set to /usr/local/, or /usr/ by default in the Makefile. And depending how the build system is set up, you might be able to set the prefix and other variables by passing them as parameters to the configure script.

Executables will typically be installed in the bin/ subdirectory of the prefix directory. Shared libraries will end up in the share/lib/ sub-directory, man pages will end up in the share/man/ sub-directory etc.

So for anything using configure and make - you could try grepping content of the extracted archive to see what the PREFIX variable is set to.
E.G.
Bash:
grep -RiHn prefix ./
That will show lines containing “prefix” (regardless of the casing), the line number and the name of the file that it occurred in.

So that might yield some clue as to where an archive is installing things to.
But again, if the archive uses a different build system - it could be set up differently.
 
Well explained @JasKinasis Big THX man.
@khedger the ./configure file contains configuration settings, just check the content of the file before running it ./configure.sh Some of them are heavily commented to give you idea what settings you can edit in them, quite often ReadMe files contain this information. Check out carfuly the posts by @JasKinasis as he had some good points for you. I have found also a nice guide for you that may make this task a bit clearer for you, it is title for beginers but it probably for someone between beginner and intermediate, but it is a nice read so give it a try. I am new to the forum and I may break some rules about external links, if so I am really sorry, will put an effort to find an explanation in the forum next time, just want to help. Good luck and get back to us for more.

Beginner's Guide to Installing from Source on The Mine of Information
 
big thanks to JasKinasis and light_eater. I feel like I at least have SOME understanding of how to investigate the contents of a tarball and figure out what's going to happen, and that's EXACTLY what I was looking for.

keith
 
G'day Keith, you have every right to be confused about tarballs ... they confuse me, and I am looked upon by some as being an expert (poor misguided, myopic fools, I love you all).

So what I do when I have to be dragged kicking and screaming to install from tar, is to refer to a couple of bookmarks I have in amongst a ginormous wad of Linux bookmarks, and they are namely as follows. Which one you use will depend upon the circumstances.

https://www.interserver.net/tips/kb/extract-tar-gz-files-using-linux-command-line/

https://www.makeuseof.com/tag/compile-install-tar-gz-tar-bz2-files-ubuntu-linux/

https://www.tecmint.com/download-and-extract-tar-files-with-one-command/

https://tecadmin.net/extract-archive-file-linux/

The one from MUO (MakeUseOf) is as recent as December 29th last, but the others are still current.

HTH (hope this helps)

Wizard
 
Dear @khedger I am very happy to be of any help.
If you would like to find where some programs are installed, you may find this commands useful:

if dpkg installed:

~$ dpkg --listfiles program_name
# files used by given program

~$ lsof -p PID
# this useful thing will show you all files that given process is using

~$ lsof -p PID | grep bin
# to find where given process binary is

~$ lsof -p PID | grep .so
# which share libs process uses

to find a PID use:

~$ top | grep program_name
# stop 'top' execution with: ctrl + c, the first column is a PID of a process

if a program is running and you know the name or its part:

~$ ps -ef | grep program_name
# to look in all processes, flags 'e' - all, 'f' - format, the last position is a path, the second is a Process ID

if a program is running but you are not sure of a name:

~$ ps -ef | grep UserName (up to 7 first letters)
# that all processes run by a user, look on a time to help you find the right one.

and other way around:

~$ dpkg -S /file_name
# list programs that use a given file

Hope that is going to be useful.
@wizardfromoz thank you for the links, and do not put yourself down, one of your videos has help me when needed to move free space in a HDD to the middle of drive to expand a partition. Big THX for that.
 

Members online


Latest posts

Top