+49 (0) 6172 / 5919-0 info@flam.de

Convert tar.gz to ZIP/ZSTD on the Command Line

The only CLI tool that converts between all archive formats while preserving symlinks, POSIX permissions, timestamps and extended attributes. ZSTD output included.

# Convert 2TB of legacy .tar.gz to .tar.zst
flrpak in='releases/*.tar.gz' \
        out-dir='releases-zstd/' \
        out-format=tar.zst \
        on-error=continue
Symlinks preserved ZIP64 supported Streaming — no temp files

Why shell scripts and 7-Zip fail

The Stack Overflow answer breaks production

zcat file.tar.gz | zip - — the most-upvoted answer for archive conversion — silently drops symlinks, fails on files larger than 4 GB, corrupts Unicode filenames, discards POSIX permissions, strips xattr, and loses empty directories. You only notice the breakage after the originals are gone.

7-Zip is not a conversion tool

7-Zip's own documentation states: "On Linux/Unix, in order to backup directories you must use tar." 7-Zip produces no ZSTD output, and copies symlinks as file content instead of preserving them as links. Its GUI workflow was not designed for server-side batch migration.

Source: 7-Zip man page, sevenzip.osdn.jp

ZSTD is already the container standard

OCI Image Spec v1.1 (February 2024) made ZSTD the official compression standard for container images. Your tar.gz release artifacts are becoming legacy format. Migrating now — before your CI/CD pipelines or registries force the issue — avoids last-minute scrambles.

Source: OCI Image Spec v1.1, opencontainers.org

flrpak vs. 7-Zip — feature by feature

Feature 7-Zip flrpak
Unix permissions in ZIP output
Symlinks preserved
ZSTD output
ZIP64 (files > 4 GB) ✗ (TAR workaround required)
Extended attributes (xattr)
UID/GID names
Nanosecond timestamps
Batch repack (glob patterns)
Streaming (no temp disk)
ZSTD dictionary training
CLI-first design GUI-first

What flrpak can do

Input formats: .tar.gz / .tgz  ·  .tar.bz2  ·  .tar.xz  ·  .tar.zst  ·  .zip (ZIP32 + ZIP64)  ·  .tar — all freely combinable in a single batch run.

🔗

Full Metadata Preservation

Symlinks, hard links, POSIX permissions, UID/GID names, nanosecond timestamps and extended attributes (xattr) are carried across every format boundary.

📦

ZIP64 Support (> 4 GB)

Files and archives larger than 4 GB are handled transparently with ZIP64 extensions. No special flags needed — flrpak detects size thresholds automatically.

Streaming — No Temp Files

flrpak reads the input stream and writes the output stream in one pass. No disk space for intermediate extraction is required, even for multi-GB archives.

🔄

Batch with --on-error=continue

Process an entire directory tree of archives in one command. Failed files are logged and skipped; conversion of the remaining archives continues uninterrupted.

📚

ZSTD Dictionary Training

Train a shared ZSTD dictionary from a corpus of archives to achieve significantly better compression ratios on small files — ideal for release artifact repositories.

🔍

--dry-run + Progress Display

Simulate an entire batch job before touching a single file. Real-time progress output shows file counts, bytes processed, and estimated time remaining.

flrpak verify

Built-in integrity check reads every entry in an output archive and verifies checksums against the source, giving you proof that the conversion was lossless.

🌐

Multi-Platform

Native binaries for Linux x86-64, Windows x64, AIX Power, and Solaris SPARC. No runtime dependencies. Single static executable — drop it into any CI/CD pipeline.

Why migrate to ZSTD now?

Fedora 31 · 2019

Fedora adopts ZSTD as the default RPM compression algorithm, replacing XZ for faster installs with equal or better ratios.

Linux Kernel 5.13 · 2021

Kernel modules are compressed with ZSTD by default. Boot times improve measurably on large module sets.

Docker Engine · March 2023

Docker Engine ships ZSTD pull support for container image layers, reducing image pull times in bandwidth-constrained environments.

OCI Image Spec v1.1 · Feb 2024

ZSTD becomes the official compression standard for OCI container images. tar.gz is now legacy for new image builds targeting modern runtimes.

AWS Fargate · ongoing

AWS Fargate documentation notes shorter container pull times when images use ZSTD-compressed layers versus gzip, reducing cold-start latency for serverless workloads.

Pricing

AIX / Midrange

€29
per month, per server

IBM AIX on Power and Solaris SPARC/x86. Same feature set as Linux.

Contact Sales

Annual: €296/year — save 15%

Free trial: convert archives up to 100 MB — no registration required.

Frequently Asked Questions

Why can't I just use 7-Zip to convert archive formats?

7-Zip is an excellent file archiver, but it was designed for interactive use and Windows-first workflows. Its own documentation explicitly recommends using TAR as a wrapper when archiving Unix directories — because 7-Zip itself does not preserve POSIX permissions, symlinks, or extended attributes inside ZIP output. It also produces no ZSTD-compressed output. flrpak is built specifically for server-side, cross-format archive migration with full metadata fidelity.

Does flrpak preserve symbolic links?

Yes. Symbolic links are represented natively in the output archive using the appropriate extension for each format: the UNIX extra field in ZIP, and the standard link entry type in TAR. Hard links are also preserved. Shell-pipeline approaches (zcat | zip) dereference symlinks and copy the target file content instead — flrpak does not.

What is ZIP64 and why does it matter?

The original ZIP specification from 1989 uses 32-bit fields for file sizes and archive offsets, imposing a hard limit of approximately 4 GB per file and 65,535 entries per archive. ZIP64 extends these fields to 64-bit, removing both limits. flrpak automatically uses ZIP64 extensions when needed, so you never have to think about it. Many older tools — including common shell-pipeline recipes — silently truncate or reject files that exceed the 4 GB threshold.

Can flrpak handle 2 TB of files in batch mode?

Yes. The in parameter accepts glob patterns that expand to thousands of archives. Combined with on-error=continue, a failed archive is logged and skipped rather than aborting the entire run. Because flrpak streams each archive without temporary extraction, disk space usage during the run is minimal — you need only enough space for the output files, not a full intermediate copy.

What is ZSTD dictionary training?

ZSTD achieves its best compression ratios on large files. For repositories full of small files — source tarballs, package archives, build artifacts — a shared dictionary can be trained from a representative corpus. The dictionary captures patterns common across all files, giving the compressor a head start on each new archive. flrpak includes a train-dict subcommand that automates this workflow and embeds the resulting dictionary into subsequent conversions.

Does flrpak work in GitHub Actions?

Yes. flrpak ships as a single static binary with no runtime dependencies. Add it to your runner via a download step or commit it to your repository's tool cache. A typical use case is a release workflow that converts a freshly built tar.gz artifact to tar.zst before uploading to GitHub Releases or an OCI registry — replacing a multi-step shell pipeline with a single flrpak command that preserves all metadata.

Start converting archives today

Free trial up to 100 MB. Monthly or annual billing.

Download Free Trial