Get a site

Package repo, opkg and “unzip: Invalid gzip magic” error

Looks like recently something got wrong either in the AlterVista web server or CloudFlare caching/CDN layers and now Packages.gz file (containing repo index and used by opkg) returned by the web server to clients like opkg and wget is actually unpacked on the fly. That’s quite weird, because no one asks for that, and that naturally confuses opkg. Moreover, when using browser everything is ok.

So if your opkg started failing with error like the below – simply replace all “src/gz” with “src” in the /etc/opkg/base-feeds.conf file. That will switch opkg to using the unpacked Packages file, which works ok. The only downside is several more seconds added to the “update” and “install” operations due to more data being exchanged. I’m trying to investigate why the web server tries to be that smart and will post an update when I have more information.

Example of the error:

[email protected]:~/tests# opkg update
Downloading http://alextgalileo.altervista.org/pkgrepo/all/Packages.gz.
Inflating http://alextgalileo.altervista.org/pkgrepo/all/Packages.gz.
Updated list of available packages in /var/lib/opkg/all.
Downloading http://alextgalileo.altervista.org/pkgrepo/clanton/Packages.gz.
Inflating http://alextgalileo.altervista.org/pkgrepo/clanton/Packages.gz.
Updated list of available packages in /var/lib/opkg/clanton.
Downloading http://alextgalileo.altervista.org/pkgrepo/i586/Packages.gz.
Inflating http://alextgalileo.altervista.org/pkgrepo/i586/Packages.gz.
Updated list of available packages in /var/lib/opkg/i586.

Collected errors:
* unzip: Invalid gzip magic
* unzip: Invalid gzip magic
* unzip: Invalid gzip magic

Leave a Reply

Your email address will not be published.