Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

difference between .tar.gz and .tgz

2,900 views
Skip to first unread message

Tobe

unread,
Oct 27, 2001, 9:07:24 AM10/27/01
to
What is the difference between the above archive formats? Just wondering as
pkgtool does not pick up the .tar.gz archives which I have downloaded -- is
there anyway to convert them to .tgz's... or can I just rename them? Go
easy -- I'm a newbie :) TIA.

Tobe.


Cyrus

unread,
Oct 26, 2001, 9:25:24 AM10/26/01
to
Tobe wrote:


hi,

tar.gz are normally source codes you have to untar and unzip them by
issuing the command tar -zxvf .....tar.gz...


some source code comes in .tgz format as well... although this is the
sort of format pkgtool, installpkg,etc uses for slackware... anyway, if
you're not too sure on how to compile programs from source. i suggest
you download programs for slackware with the .tgz format these can be
found on: http://linuxmafia.org

there should be some pointers for you to consider. when installing from
source, usually after untarring the tar.gz file you've downloaded you cd
into the directory where it unpacked the file and read the INSTALL or
sometimes README file... this teaches you how to compile the program...
it's better if you are compiling from source because you are making the
program to suit your system. e.g. 586, 686, etc. which makes it
reasonably better. when installing packages like the .tgz format your
only compiling(installing) it for a 386 machine... anyway, read on...

hope it helps...

cheers!

cyrus

--


Cyrus Santos

Registered Linux User # 220455
Sydney, Australia

"...the best things in life are free...."

George Georgakis

unread,
Oct 26, 2001, 9:47:50 AM10/26/01
to
This is a slightly confusing topic for a newbie.

A .tar.gz file is _always_ a simple archive of files, very much like a
standard WinZip file. In the _general UNIX world_, a .tgz file is
actually the same as a .tar.gz file. You can freely switch the
extensions of these two without affecting the uncompression of the
file.

However Slackware has extended the .tgz format further, using it for
its own unique packaging system. This system dictates that a Slackware-
compatible .tgz file must contain all precompiled binaries, man pages
and suchlike in a manner that _imitates the Slackware filesystem_. That
is, if a binary is meant to go into /usr/local/sbin, then the .tgz
package must contain a usr/local/sbin/ directory containing that
binary. So if you were simply cd to / and uncompress a Slackware
package, it will neatly expand into all the right locations. Do the
same with a standard tarball (whether in .tar.gz or .tgz format), and
lots of strange new directories would tend to appear in /. Note that
you can always uncompress a Slackware .tgz file with tar, unlike with
.rpm and .deb files.

Another giveaway of a Slackware-specific .tgz file is the existence of
a install/doinst.sh script. This script executes certain commands after
the package is installed, though it doesn't exist in all Slackware
packages. For example, my own openssh.tgz package includes a
install/doinst.sh script that automatically generates all the required
keys immediately after the package is installed.

But, as a general rule, unless a .tgz file is _clearly_ identified as a
Slackware package, then the odds are that it's a simple archive,
usually source code that needs to be compiled before being installed.

If you want to pick whether a .tgz file is indeed a Slackware package,
execute "tar ztvf pakagename.tgz" and do the following:
a) Check if a install/doinst.sh file exists. If it does, it's
definitely Slackware.
b) Look at the directory structure. If it follows the usual /etc, /usr,
/sbin (etc) filesystem, it's likely a Slackware package.
c) Look at the file permissions. If there are a number of executables,
and expecially if they follow the directory structure of point b), then
it's very likely a Slackware package.

---------------------------------------------

"Tobe" <---t...@bigfoot.com---> wrote:

--
George Georgakis - geegs(a)tripleg.net.au - http://www.tripleg.net.au

Lee

unread,
Oct 26, 2001, 8:34:38 PM10/26/01
to

George Georgakis

unread,
Oct 26, 2001, 11:29:02 PM10/26/01
to
It looks OK for those who prefer GUI (I don't). But that link doesn't
answer the original question.

--------------------------------------------------------

"Lee" <l...@pngusa.net> wrote:

> http://slack-pack.sourceforge.net/about.htm

D. Stussy

unread,
Oct 27, 2001, 2:41:37 AM10/27/01
to
3 characters in the filename. That's it.

This is one of those "Microsoftisms" that crept in from the old 8.3 filename
format; just another curse from BG.

George Georgakis

unread,
Oct 27, 2001, 2:58:00 AM10/27/01
to
No, that's not "it". Read what I wrote.

-------------------------------------------------

"D. Stussy" <kd6...@bde-arc.ampr.org> wrote:

> 3 characters in the filename. That's it.

--

Markus Stoeger

unread,
Oct 27, 2001, 4:50:17 AM10/27/01
to
ge...@tripleg.GOAWAYSPAMMERS.net.au (George Georgakis) wrote in
<Xns9147ACEB9619Ege...@203.50.2.80>:

>No, that's not "it". Read what I wrote.

That is a shorter version of what you wrote. The file format of .tgz files is
exactly the same as the one of .tar.gz files.. both are just a compressed file
archive. The only thing that makes a .tar.gz or .tgz file a slackware package
is the directory structure of the files it contains.

Earlier versions of the slackware package tools still supported both
extensions. On slackware 7.0 I can install and create .tar.gz files, while on
the new 8.0 version it only accepts .tgz files. for whatever reason.. I liked
the .tar.gz extension better and all my own packages have a .tar.gz extension
(when I switch to 8.x I'll have to rename them..).

I guess they only use .tgz (MS's 8.3 letter standard) so that the filenames on
the installation disks display correctly when viewed on a MS system.

>pkgtool does not pick up the .tar.gz archives which I have downloaded -- is
>there anyway to convert them to .tgz's... or can I just rename them?

short answer for the original poster - just rename and then install them _IF_
you are sure that they are really slackware packages, i.e. if they contain a
slackware directory structure and binaries (check with tar -tzvf file.tar.gz).

If the file contains mostly .c and .h files then you have downloaded the source
code of a program that you have to compile yourself. Copy such files to a
temporary directory (or /usr/src if you want to keep the source code),
uncompress it with tar -xzvf file.tar.gz and then read the included INSTALL and
README files.

Max

Magnus Østergaard

unread,
Oct 27, 2001, 11:20:07 AM10/27/01
to
Cyrus wrote:
>

Hello Tobe and Cyrus,

Cyrus, I understand you are from 'down under', but how can you answer a
post before it is posted? (Hint: Set you clock.)

> Tobe wrote:
>
> > ... difference between .tar.gz and .tgz ...


>
> tar.gz are normally source codes you have to untar and unzip them by
> issuing the command tar -zxvf .....tar.gz...
>
> some source code comes in .tgz format as well... although this is the
> sort of format pkgtool, installpkg,etc uses for slackware... anyway, if

Just to make sure we undestand each other.

A 'tar.gz' file is a collection of files that has been compressed.

The tar program takes several files and makes them into one file.

~$ tar -cvf filename.tar /somedir/*

The filename.tar now contains alle the files of /somedir. In order to
save space we compress the file.

~$ gzip filename.tar

The result is a file named filename.tar.gz (aka a "zipped tar ball")

This could be done in one step, (I think it is something like: tar
-cvfz) this will produce a filename.tgz

The next question is, can I install this filename.tgz on Slackware using
pkgtool.

As I have just demonstrated, the filename.tar.gz and filename.tgz are
the same. So the answer is no.

Part of the confusion, is that a zippped tar file could have the same
name as a Slackware package. (.tgz) Though most zipped tar files are
named .tar.gz.

A Slackware .tgz is in fact just a zipped tar file, but there has been
added installation information.

So the rule of thume is:

tar.gz is the same as .tgz unless othervise stated, and should be
installed like:

~$ tar -zxvf program-1.0.tar.gz
~$ cd program-1.0
~$ ./configure
~$ make
~$ make install

This is known as installing/compilling from source. Just to confuse, the
last 3 steps could be done like:

~$ ./configure; make; make install

Hope this answers your question

--
// Magnus Østergaard

George Georgakis

unread,
Oct 27, 2001, 11:59:31 AM10/27/01
to
You also forget about the install/doinst.sh script, Markus. This is an
important part of what defines a Slackware package. Have a look at
/var/log/scripts and note how many scripts there are, and just how
involved those scripts sometimes get.

The "shorter version" explanation failed to detail the third format of
tar/gzip archive that we Slackers use. Make no mistake, the three extra
elements -- structure, binary install and scripting -- are sufficient
to distinguish a Slackware package from a ordinary .tgz. An ordinary
.tgz archive rarely contains a mirrored directory structure (except as
a backup), rarely contains binaries (ditto), and _never_ contains a
post-install executed script. Sharing the tar/gzip compression method,
in itself, doesn't make a Slackware .tgz package indistinguishable from
other .tar.gz or .tgz files.

The original poster specifically asked about Slackware's packages via
pkgtool. So an extended explanation of the differences between an
ordinary UNIX .tgz and a Slackware-style .tgz was in order. As a self-
admitted newbie, I'm sure the poster appreciated an explanation that
tells him just why some .tgz archives won't work even when apparently
installed correctly via pkgtool or installpkg.

The second half of your post was good advice, though some of it
just repeats what I already posted the first time :)

----------------------------------------------

cra...@microsuxx.com (Markus Stoeger) wrote:

>That is a shorter version of what you wrote.

<snip>

> The only thing that makes a
> .tar.gz or .tgz file a slackware package is the directory structure
> of the files it contains.

--

Markus Stoeger

unread,
Oct 27, 2001, 2:22:53 PM10/27/01
to
ge...@tripleg.GOAWAYSPAMMERS.net.au (George Georgakis) wrote in
<Xns91481EC39F081ge...@203.50.2.80>:

>You also forget about the install/doinst.sh script, Markus. This is an
>important part of what defines a Slackware package.

I didn't mention this one as it is not absolutly necessary. Most of my packages
don't have one.. only those that need some configuration after installation,
like as you said openssh's host key generation. If I want to know if a
.tgz/.tar.gz file is an installable package or not I only look at it's
directory structure (there aren't many downloadable full-system backups that
contain a similar dir structure so that has been pretty save so far :-)

oh well this is getting too long again. I guess we all know what a slack
package is by now! :-)

Max

Martha H Adams

unread,
Oct 27, 2001, 9:06:16 PM10/27/01
to
I've got a couple of ideas on this topic of .tar.gz vs .tgz. My first
one is, I don't agree with the poster who apparently feels the old 8.3
filename convention is something of a curse. For me, it's not: I use
it in all I do. Used with a little imagination, it's *big enough.*
So for me, making larger filenames just complicates my life.

My next idea is, I think the confusion arises in part from a tar
detail that did not get mentioned in the thread. Namely, that tar
does not restrict what filename you give to a file. For the command
line f <filename> you can call your tarfile maude.purple, foo.tgz,
fishfeet.tar.gz or whatever; and tar will pack it up or unpack it
nicely. So there, you can name your file xxx.tgz or xxx.tar.gz and
they are the same file.

What *other* people may have thrown into this, is something else.
Maybe in their environment, there *is* a difference; and so, if I were
dealing with such files I would not rename them: I would at least
examine a list of the files in there; and probably, I'd expand the
file to check out the pieces.

Cheers -- Martha Adams

Joost Kremers

unread,
Oct 27, 2001, 9:15:22 PM10/27/01
to
Martha H Adams wrote:
> I've got a couple of ideas on this topic of .tar.gz vs .tgz. My first
> one is, I don't agree with the poster who apparently feels the old 8.3
> filename convention is something of a curse. For me, it's not: I use
> it in all I do. Used with a little imagination, it's *big enough.*
> So for me, making larger filenames just complicates my life.

??? you do know about tab-completion? i wouldnt want to live on the
command prompt without it...

--
Joost Kremers
registered Linux user #230173
Life has its moments

Cyrus

unread,
Oct 28, 2001, 2:23:16 AM10/28/01
to
Magnus Østergaard wrote:

> Cyrus wrote:
>
>
> Hello Tobe and Cyrus,
>
> Cyrus, I understand you are from 'down under', but how can you answer a
> post before it is posted? (Hint: Set you clock.)
>

yup, it's DST up here in Sydney... both of my machines just adjusted
there times according to DST yesterday so it's cool now i guess... i
wasn't even aware it was DST already... cheers!!!

Chris Elvidge

unread,
Oct 28, 2001, 6:21:09 AM10/28/01
to
Martha H Adams wrote:
>
> Namely, that tar
> does not restrict what filename you give to a file. For the command
> line f <filename> you can call your tarfile maude.purple, foo.tgz,
> fishfeet.tar.gz or whatever; and tar will pack it up or unpack it
> nicely. So there, you can name your file xxx.tgz or xxx.tar.gz and
> they are the same file.
>
Yeah, but!

If you use gzip on a file (maude.purple) it will zip it, name the zipped
file (maude.purple.gz) and delete the original. It's gzip that uses the
.gz suffix. Gunzip similarly unzips the file to (maude.purple) and
removes the "original" (maude.purple.gz).

However "tar -zxf" doesn't care about the file "extention(s)", just
whether the file is zipped and tarred (in that order). If true it does
what you tell it, if false it throws a wobbly.

2d

Chris

Jonathan Kelly

unread,
Oct 29, 2001, 10:56:14 PM10/29/01
to
On Fri, 26 Oct 2001 13:47:50 GMT, George Georgakis
<ge...@tripleg.GOAWAYSPAMMERS.net.au> wrote:

>This is a slightly confusing topic for a newbie.
>
>A .tar.gz file is _always_ a simple archive of files, very much like a
>standard WinZip file. In the _general UNIX world_, a .tgz file is
>actually the same as a .tar.gz file. You can freely switch the
>extensions of these two without affecting the uncompression of the
>file.
>
>However Slackware has extended the .tgz format further, using it for
>its own unique packaging system.

This is not actually correct. A .tgz file is _just_ a gzip compressed
tar archive which could contain _anything_, just as .tar.gz could. In
fact .tgz is just a shorthand for .tar.gz used so the archives can be
transported through broken operating systems (you know the ones).

Slackware packages are just a collection of files packaged into
compressed tar archive.

Jonathan Kelly,
Sydney.

D. Stussy

unread,
Oct 29, 2001, 10:08:06 PM10/29/01
to

No kidding. That's why I stated that the difference between ".tar.gz" and
".tgz" is 3 characters. That's ALL that's different.

If some external package has placed some signficance on one of the file
"extensions" over the other, that does NOT make the data structure of the file
any different. Both represent gzipped tar archives prepared exactly the same
way from the point of view of applying the tar and gzip programs to a fileset
(in the same order).

George Georgakis

unread,
Oct 29, 2001, 10:49:45 PM10/29/01
to
I have already said that there's no difference between a standard
.tar.gz archive and a standard .tgz archive. Read the following
sentence very carefully. No, really. Because it's basically what I've
been saying all along :

*** A Slackware .tgz package is not simply a standard .tgz archive. ***

As stated in a previous post (that was actually quoted and then
ignored) : "However Slackware has extended the .tgz format further,

using it for its own unique packaging system".

No, Slackware hasn't touched the METHOD of compression, it remains tar
and gzip. But pkgtool (a very pertinent word in this thread, refer to
the original post!) expects the contents of an archive to be structured
in a a certain way. If it isn't, sure the archive will uncompress. But
the files won't work.

So what I wrote was "actually correct", Jonathan, thank you very much.

Geez, no wonder +Chiron+ gets grumpy with some people...

------------------------------------------------------

"D. Stussy" <kd6...@bde-arc.ampr.org> wrote:

> No kidding. That's why I stated that the difference between
> ".tar.gz" and ".tgz" is 3 characters. That's ALL that's different.


Jonathan Kelly <jke...@s054.aone.net.au> wrote:

> This is not actually correct. A .tgz file is _just_ a gzip compressed
> tar archive which could contain _anything_, just as .tar.gz could.

--

Richard

unread,
Oct 30, 2001, 1:23:29 AM10/30/01
to
The difference is that the hamsters have less room to exercise in a .tgz
file as the filename is shorter. Because they run from one end of the
filename to the other. .tar.gz was brought out to enable them to have
more room as some of them were dying from lack of exercise when the
packages were being sent over the internet.

Richard :)

D. Stussy

unread,
Oct 30, 2001, 4:01:38 PM10/30/01
to
Just because the uncompressed file structure and contents must fit an
additional contstraint (particular contents expected by another application)
HAS NO BEARING on the archive file structure itself. The data structures
comprising the tar archive and the gzip compression method have NOT been
modified nor have their algorithms. There is no difference.

Keith Keller

unread,
Oct 30, 2001, 4:41:09 PM10/30/01
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ugh. Let's summarize this thread, before it gets any more
painful.

- --The file formats .tar.gz and .tgz are identical

- --Unless you do something stupid like tar cyf filename.tgz

- --.tgz was used for Slackware packages because people might
store files on a FAT filesystem, which is restricted to
8.3

- --pkgtool uses the .tgz format, but it expects the tarball
to be packed a certain way in order to install as a Slackware
package

- --so tar.gz probably won't work with pkgtool, even though
tar.gz and tgz are identical file formats, because most people
who make Slackware packages use the name .tgz

- --.tgz and .tar.gz are just labels, nothing more, so you should
know what the file is before working with it

- --for a .tar.gz, read the documentation on how to install it

I hope there are no controversial statements here. :)

- --keith

- --
kke...@speakeasy.net
public key: http://wombat.san-francisco.ca.us/kkeller/public_key
alt.os.linux.slackware FAQ: http://wombat.san-francisco.ca.us/perl/fom

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAjvfHnMACgkQhVcNCxZ5ID9t2wCdFJ5Sb2cbKR6/6/4DCqt7ScNz
rH0An2Dh/Hh7iyfahRvaSqKHzws+nNGd
=aTwH
-----END PGP SIGNATURE-----

James Hunter Heinlen

unread,
Oct 30, 2001, 5:27:50 PM10/30/01
to
Keith Keller (kke...@speakeasy.net) wrote:

: - --pkgtool uses the .tgz format, but it expects the tarball


: to be packed a certain way in order to install as a Slackware
: package

Quick question. Is there a document handy that details this packing
algorith? Just curious. Thanks in advance for any info.

Hunter

George Georgakis

unread,
Oct 30, 2001, 6:05:27 PM10/30/01
to
Ferrchissakes! Can't you _read_ what I wrote for a change? Your post
actually quoted and then rephrased my last paragraph! You obviously
have this bee about data structure and compression algorithms, neither
of which I addressed as being part of what makes a "Slackware package".

Keith's summarisation is correct. Read it, because I won't waste any
more time on a thread that's starting to resemble a headless chook.

--------------------------------------------------------------

"D. Stussy" <kd6...@bde-arc.ampr.org> wrote:

> Just because the uncompressed file structure and contents must fit
> an additional contstraint (particular contents expected by another
> application) HAS NO BEARING on the archive file structure itself.
> The data structures comprising the tar archive and the gzip
> compression method have NOT been modified nor have their
> algorithms. There is no difference.

--

Joost Kremers

unread,
Oct 30, 2001, 6:16:08 PM10/30/01
to

maybe the slack book? http://www.slackware.com/book/ and then look at
chapter 16.

HTH

D. Stussy

unread,
Oct 31, 2001, 3:14:45 PM10/31/01
to
"What makes a 'slackware package'" is not part of the title of this message
thread.

What someone said is that there is a difference between these file formats.
That is WRONG and will continue to be wrong. What some other application puts
into the issue has NOTHING to do with whether there is a "difference between
.tar.gz and .tgz" - which is the title of this thread.

On Tue, 30 Oct 2001, George Georgakis wrote:

Keith Keller

unread,
Oct 31, 2001, 3:27:51 PM10/31/01
to
On Wed, 31 Oct 2001 20:14:45 GMT, D. Stussy <kd6...@bde-arc.ampr.org> wrote:
>"What makes a 'slackware package'" is not part of the title of this message
>thread.

No, but it *was* part of the original post, which (paraphrased)
asked why pkgtool didn't pick up tar.gz files.

The title of a thread isn't the only factor in determining the
contents of posts. The context of the original post is
quite important--if we just answer the title, we won't actually
address the OP's problem.

--keith

Chris

unread,
Nov 1, 2001, 1:40:23 AM11/1/01
to
Chris Elvidge <apl...@emirates.net.ae> wrote in message news:<3BDBEA25...@emirates.net.ae>...


tar -cvf - ./*|gzip > ThisIsNotaTarredGzippedfile.doc

Works fine.

One question though, as I am not yet but soon will be using Slackware.
Does Slackware pkgtool require .tgz, or is it just a convention?

(another) Chris

0 new messages