linux – Invalid compressed data–format violated?

linux – Invalid compressed data–format violated?

Your command is correct. But it seems the file is corrupted.nIts easy to tell, when some files are correctly extracted (for example ./dokuwiki/.htaccess.dist), but not the rest.

n

Recreate the dokuwiki.20151010.tar.gz file, and make sure it doesnt report errors while doing so.nIf you downloaded the file from somewhere, verify the checksum, or at least the file size.

n

The bottomline is, either the file was incorrectly created or downloaded.nThe command you have should work fine with a .tar.gz file.

b’

Alternative Location of Gzips fixgz Utility

n

In case you can no longer find fixgz on gzip.orgs website, here is a link to a version available on archive.org: https://web.archive.org/web/20180624175352/http://www.gzip.org/fixgz.zip.

n

Source Code for fixgz Utility

n

Also, in case that disappears as well, below is the source code for the fixgz utility:

n

/* fixgz attempts to fix a binary file transferred in ascii mode byn * removing each extra CR when it followed by LF.n * usage: fixgz  bad.gz fixed.gznn * Copyright 1998 Jean-loup Gailly <[email protected]>n *   This software is provided as-is, without any express or impliedn * warranty.  In no event will the author be held liable for any damagesn * arising from the use of this software.nn * Permission is granted to anyone to use this software for any purpose,n * including commercial applications, and to alter it and redistribute itn * freely.n */nn#include <stdio.h>nnint main(argc, argv)n     int argc;n     char **argv;n{n    int c1, c2; /* input bytes */n    FILE *in;   /* corrupted input file */n    FILE *out;  /* fixed output file */nn    if (argc <= 2) {n    fprintf(stderr, usage: fixgz bad.gz fixed.gz\n);n    exit(1);n    }n    in  = fopen(argv[1], rb);n    if (in == NULL) {n    fprintf(stderr, fixgz: cannot open %s\n, argv[1]);n    exit(1);n    }n    out = fopen(argv[2], wb);n    if (in == NULL) {n    fprintf(stderr, fixgz: cannot create %s\n, argv[2]);n    exit(1);n    }nn    c1 = fgetc(in);nn    while ((c2 = fgetc(in)) != EOF) {n    if (c1 != \r || c2 != \n) {n        fputc(c1, out);n    }n    c1 = c2;n    }n    if (c1 != EOF) {n    fputc(c1, out);n    }n    exit(0);n    return 0; /* avoid warning */n}nn

linux – Invalid compressed data–format violated?

Gzip has a prospective fix for this error in their FAQ. The provided utility didnt help in my case, but its possible it would fix your archive. According to gzip:

n

n

If you have transferred a file in ASCII mode and you no longer have access to the original, you can try the program fixgz to remove the extra CR (carriage return) bytes inserted by the transfer. A Windows 9x/NT/2000/ME/XP binary is here. But there is absolutely no guarantee that this will actually fix your file. Conclusion: never transfer binary files in ASCII mode.

n

Leave a Reply

Your email address will not be published.