View Full Version : Install .tar.gz?

25th December 2006, 10:40 PM
I am happily learning to use my first installment of fedora... many questions yet.

Specifically: I have a program that I downloaded for linux that has a .tar.gz ending. Can that be installed in Fedora? If so, could you please give me a detailed description of how to do it?

Remember, I am just starting. :)


25th December 2006, 10:53 PM
Hi, by the time I've finished this post, I imagine it will have already been answered several times, but here goes anyway!

A tar.gz file is an archive of files which has been zipped up. The archive, called a tar contains many other files, these have been put together in a collection, called a tar archive. This is a throwback to ancient Unix lingo, tar was a tape archive from the days when tapes were the main medium for storing large amounts of data. Because tar archives are usually quite large, they are often zipped up. This adds the .gz extension to the tar file.

You can think of your file as two layers. Lets say the file is called collection.tar.gz. First of all, you have to unzip it. This can be done with the following:

unzip collection.tar.gz

The reason you have put an ls there is to show what files are in the directory. You will now have a file called collection.tar.
The next step is to untar the the tar file, that is, to get the files out of the archive. To do this, you use:

tar -xvf collection.tar

This will extract all of the files from the tar archive, putting them in the same directory structure as was in the tar file.

*** EDIT ***
The default tar command comes with many options, of which -xvf are three. Excerpts from man page:

-x, --extract, --get
extract files from an archive
-f, --file [HOSTNAME:]F
use archive file or device F (default "-", meaning stdin/stdout)
-v, --verbose
verbosely list files processed

Or, to explain in English: The x removes all of the files from the archive, the f specifies which tar archive you are using and the v lists the files as they are processed.

Please note, this is a general bit of information for unzipping/untarring files, not installing software. When you untar and unzip software, it often has its own seperate requirements for a complete install.

If you need any further help, please ask!

25th December 2006, 11:29 PM
Many thanks for the clear explanation. But I guess there is a problem with the file, as the following shows:

[root@localhost home]# unzip bgbuddy-1.22.tar.gz
Archive: bgbuddy-1.22.tar.gz
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of bgbuddy-1.22.tar.gz or
bgbuddy-1.22.tar.gz.zip, and cannot find bgbuddy-1.22.tar.gz.ZIP, period

The program itsel is not important. What I wanted to learn is how to import and install programs that are not in the Fedora list of packages.

In any case, many thanks for the information. I am learning bit by bit.

25th December 2006, 11:37 PM
Try this:

gunzip -c some_package.tar.gz | tar xvf -

That will unpack the tarball in the current directory, preserving whatever directory structure is in the tarball.

25th December 2006, 11:56 PM
OK... mande another try with gunzip. But this time the response was:

tar: old option "f" requires an argument.

Boy, you sure need patience with Linux!!!

26th December 2006, 12:01 AM
OK... mande another try with gunzip. But this time the response was:

tar: old option "f" requires an argument.

Boy, you sure need patience with Linux!!!
Are you sure you typed the tar command correctly, with a space and a dash at the end, as I indicated?

26th December 2006, 12:05 AM

There are many ways to do things in Linux. What RupertPupkin is suggesting is that you unzip and untar in the same step, this is using the pipe operator, meaning the output of one command becomes the input of the next.

My personal opinion is that if you can do something in three steps, while you are still trying to figure it out, do it in three rather than adding fancy pipes and other stuff like that.


PS - Therefore, your sequence of commands would like this:

gunzip file.tar.gz
tar -vft file.tar

26th December 2006, 12:20 AM
Well, I have progressed. I now have a .tar file

But... when I tried the tar command I got an answer:

you must specify one of the "Acdtrux" options

26th December 2006, 12:26 AM
OK... an earlier reply solved the matter. The tar command that worked was:

tar -xvf program.tar

At least I have gotten down to the program level. I will have to leave the instalation for another day.

Many thanks those who sent an answer.

27th December 2006, 04:06 AM
For future reference:

tar xzvf filename.tar.gz or
tar xzvf filename.tgz

tar xjvf filename.tar.bz2
if the file was compressed with the new and more efficient bzip2 program instead of gzip

27th December 2006, 07:32 PM
Many thanks, George. I am carefully filing away these suggestings as to how to conquer Linux... it is a bit different from the old DOS days...

28th December 2006, 01:14 AM
You could make a directory and for example call it "bgbuddy" and place your file "bgbuddy-1.22.tar.gz" in it then right click on it and select "Open with "Archive Manager" then select "extract" from the newly opened window and another window opens and select "extract" again.

All of the files will be unpacked in a new directory within the one you created. You will have to look at the "readme" and "install" file to see if there is anything special you may need to compile it. Most likely it will say something like " to build use "./configure" then "make" and as root "make install". But it will be important to read those two readme and install files first to be sure.

You will want to install the necessary tools to do the build so go ahead and install using yum:

# yum install rpmdevtools


28th December 2006, 01:31 AM
Hmmm... that seems like a much less complicated way to go. I was surprised recently when Fedora installed Skype directly, I didn't even have to manipulate a downloaded file. I can see that the new versions make it easier for beginners to handle such things.

So will try what you suggest. And thanks.

28th December 2006, 02:24 AM
OK I went and downloaded the bgbuddy.tar.gz file and followed my instructions. There were 5 files that were unpacked "bgbuddy.pl, bgbuddy.png, changelog, license and readme". As root I placed the bgbuddy.pl file in /usr/bin then opened a terminal and entered "$ bgbuddy -gn -ce /path/to/images" to get it going. Check the readme for more info.

There's a wallpaper changer available from the repo called "wallpapoz" you might be interested in.

# yum install wallpapoz


28th December 2006, 12:08 PM
Very good. Thanks for the "working" model. bgbuddy was really a test, but I very much would like to have a wallpaper changer. Over the years I have collected a lovely folder of pictures, and on my Windows work machine I use Wallpaper Master to rotate them every 20 minutes. Not really necessary, but very enjoyable.
And since I hope soon to convert my work machine to Fedora, the changer would be very welcome.

28th December 2006, 01:56 PM
I downloaded the tar.gz of firefox 2.0 but I can't find it on my system?
What I want to do is update How do I go about doing that without hashing through all kinds of code to do it? I would be so grateful for any help.

thanks - bigmac :confused:

28th December 2006, 06:01 PM
Open a terminal and enter eg:

$ locate firefox-2.0.tar.gz

and it should print the location.