Gzip and bzip errors

I’m trying to install software on new Rocky Linux server and several of my applications are tarballs. When I try to run either tar -xvf on either a .gz or .bz2 file I get error “gzip: stdin: not in gzip format” or “bzip2: (stdin) is not a bzip2 file.” I have never encountered this before and I wondeer if anyone has an idea what is happening? (The files in question are the APR files from Apache so probably are what they say they are)

Can you verify the file is what you think it is using the file utility? Example:

$ file filename
filename: gzip compressed data

Weird.

I tried to tar-extract it and failed same as last evening.

Then I did the file name routine and tar worked properly. Didn’t do anything else. I had expected
that file would read the extension and use that to decide what kind of file it was. Now I will
revisit the other files that failed to extract and see if they will open.

Sorry for bothering you and i have no idea why this worked out this way as the problem has
persisted off and on over the two weeks I have had Rocky installed.

Regards,

John

I just realized that I tried the wrong file. The Apache source DID
extract properly before. It is the apr source that is the problem and I get the
following:

file apr-1.7.4.tar.gz
apr-1.7.4.tar.gz: HTML document, ASCII text, with very long lines
[John@prod02 tmp]$ file apr-1.7.4.tar.bz2
apr-1.7.4.tar.bz2: HTML document, ASCII text, with very long lines

So it looks like the problem is with Apache and not Rocky; I’ll report it to
them.

Thanks for the help and information fellows. I do have some other files like
this and I’ll have to check that they are actually what they say they are too.

John

Look at the size of the file. Is it small? Did you download it by choosing “Save link as” in the browser?
On some web pages there are links that look like they are to files, but are actually to another page;
one has to follow the link rather than save it.

What I did was use wget to pull the file from the link on the Apache home page
but as the Apache support team pointed out the link that i used is not on their
server.

The better approach seems to be to use the version in the Rocky repository and
just update the config files as necessary.

That should preclude any other problems I might encounter in compiling it too.
In the past I have pulled the downloads from Apache and compiled but that was a
while back. This is our first new server in several years and my skills are a
bit rusty at the moment and there is enough that has to be done and…

John