Categories: Ubuntu

Solved “gzip: stdin: not in gzip format” error in Linux/Unix

In this article, we will see how to solve "gzip: stdin: not in gzip format" error in Linux/Unix based systems. Many times you might have observed that while trying to extract compressed file using tar command, you get "gzip: stdin: not in gzip format" error in your system. This error can only occur in few scenarios which I am going to explain below. But before that let me explain more about gzip compression and decompression.

gzip, also known as GNU Gzip, is a popular data compression program developed under GNU Project. This program can be used both for compression and decompression. It is usually used in conjunction with tar archival to reduce the original final size significantly hence producing the final output in tar.gz format. That’s why you will find many of the packages available for download in this format only. It results into smaller file size and hence make download quicker and faster.

 

Solved “gzip: stdin: not in gzip format” error in Linux/Unix

Also Read: How to Install Flutter on Ubuntu 22.04 LTS (Jammy Jellyfish)

Now coming back to the point, as I was discussing gzip: stdin: not in gzip format error could occur when you try to extract .tar.gz or any other file format such as .tar.xz using tar command. But this can only happen in two different cases. Let’s see both the cases one by one.

 

Case 1: When target is not gzip format file

In most of the cases, you will see gzip: stdin: not in gzip format error due to target file not in gzip format even though it looks like in tar.gz format as you can see in one of the instances below. Due to some reason this file is either moved or renamed as tar.gz file. So in that case it is also difficult to find out the real file format to extract it properly.

cyberithub@ubuntu:~$ tar -xzvf artifactory-pro.tar.gz

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

It is also possible that the file may not be archived also, in that case if you just run tar -xvf artifactory-pro.tar.gz command then also you will get the same error.

cyberithub@ubuntu:~$ tar -xvf artifactory-pro.tar.gz

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

But if one knows the original format of the file then they can extract it properly by using the correct option with tar command or with correct utility.

 

Case 2: When -z option used on other file format

Another most frequent mistake that users always do is that they use -z option with tar command on files which are not compressed in gzip format. Probably the file was just archived and not compressed. So this again result into gzip: stdin: not in gzip format error as you can see below.

cyberithub@ubuntu:~$ tar -xzvf flutter_linux_3.13.0-stable.tar.xz

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

In those cases, to fix the error you just need to remove -z option as there is no gzip compression done and run above command without filtering through gzip then it will work properly and the files will be extracted without any error.

cyberithub@ubuntu:~$ tar -xvf flutter_linux_3.13.0-stable.tar.xz

 

Conclusion

Hope above explanation would be enough to explain you the error and solution that you need to take based on the use case scenario in your system. But even after following above steps, if you are still facing the same error then don’t hesitate to write me about your problem in comment box so that we can work together to solve your problem as well.

Ubuntu Server Admin

Recent Posts

Advantech AOM-2721 is now Ubuntu Certified

Canonical announces that the Advantech AOM-2721 is officially joining the list of Ubuntu Certified Hardware.…

4 hours ago

Ruby and Rails Performance Roundup: The Backlog Edition

Yet again instead of tweets, a blog post. The backlog got out of hand -…

4 hours ago

How to Deploy OpenProject on Ubuntu VPS

This article provides a guide demonstrating how to deploy OpenProject on Ubuntu VPS. What is…

5 hours ago

Canonical integrates NVIDIA Nemotron 3.5 Lightning with Ubuntu for always-on AI agents

Canonical is pleased to announce that  NVIDIA’s newly introduced NVIDIA Nemotron 3.5 Lightning, an open,…

2 days ago

Xfwl4’s Second Preview Release

I’m pleased to announce the second preview release of xfwl4, Xfce’s Wayland compositor, version 4.21.1.…

2 days ago

How to Install, Secure, and Set Up MySQL on Ubuntu 26.04 LTS

If you have been using an ecommerce store to place online orders or have been…

3 days ago