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

Sponsored
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.

Sponsored
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

Canonical announces 12 year Kubernetes LTS

Canonical’s Kubernetes LTS (Long Term Support) will support FedRAMP compliance and receive at least 12…

13 hours ago

Ubuntu Weekly Newsletter Issue 878

Welcome to the Ubuntu Weekly Newsletter, Issue 878 for the week of February 2 –…

1 day ago

How your feedback shapes the way we support open source software

At Canonical, we firmly believe that delivering an outstanding, customer-centric support experience is impossible without…

2 days ago

How To Install osTicket v1.14 On Ubuntu 20.04

I want to share how to install osTicket v1.14 for Ubuntu 20.04 server. osTicket written…

3 days ago

How To Install WordPress On Ubuntu 20.04

Now I want to share how to install WordPress on ubuntu 20.04 server. WordPress is…

3 days ago

How To Install DNS Server (Bind9) On Ubuntu 20.04

Now I want to share the DNS server installation process on your Ubuntu 20.04 server.…

3 days ago