It is also possible to decompress it using standard shell-script + gzip, if you don't have, or want to use openssl or other tools.
The trick is to prepend the gzip magic number and compress method to the actual data from zlib.compress:

printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" |cat - /tmp/data |gzip -dc >/tmp/out

Edits:
@d0sboots commented: For RAW Deflate data, you need to add 2 more null bytes:
โ†’ "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x00"

This Q on SO gives more information about this approach. An answer there suggests that there is also an 8 byte footer.

Users @Vitali-Kushner and @mark-bessey reported success even with truncated files, so a gzip footer does not seem strictly required.

@tobias-kienzler suggested this function for the bashrc:
zlibd() (printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" | cat - "$@" | gzip -dc)

Answer from wkpark on Stack Exchange
๐ŸŒ
Ubuntu
manpages.ubuntu.com โ€บ focal โ€บ man(3)
Ubuntu Manpage: zlib - compression and decompression operations
The transformation can be removed again with chan pop. The mode argument determines what type of transformation is pushed; the following are supported: ... The transformation will be a compressing transformation that produces zlib-format data on channel, which must be writable.
Discussions

linux - How to run zlib from terminal on Ubuntu? - Unix & Linux Stack Exchange
I've installed zlib1g but still zlib isn't available from the terminal. How can I find the executable to run it? Or is there an easier way I'm overlooking? The reason for this is that I want to com... More on unix.stackexchange.com
๐ŸŒ unix.stackexchange.com
September 28, 2022
red lang - How to decompress/deflate zlib data [rfc1951]? - Stack Overflow
I am looking for decompressing data according to the deflate compression mechanism [rfc1951]. The linux command for this mechanism is: zlib-flate -uncompress I try the Red command decompress with More on stackoverflow.com
๐ŸŒ stackoverflow.com
Zlib uncompression for an noob

Looks like zlib compressed data, here's more info how to deflate it: https://unix.stackexchange.com/questions/22834/how-to-uncompress-zlib-data-in-unix

More on reddit.com
๐ŸŒ r/LiveOverflow
5
6
March 27, 2020
blob - How can I DEFLATE with a command line tool to extract a Git object? - Stack Overflow
Related question for people who ... want to decompress data with cURL: stackoverflow.com/questions/8364640/โ€ฆ ... Save this answer. ... Show activity on this post. Something like the following will print the raw content, including the "$type $length\0" header: perl -MCompress::Zlib -e 'undef ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
GitHub
github.com โ€บ kevin-cantwell โ€บ zlib
GitHub - kevin-cantwell/zlib: A command-line utility for quickly compressing or decompressing zlib data. ยท GitHub
Without any arguments, zlib will compress an input stream. Use the -d flag for decompression.
Starred by 48 users
Forked by 4 users
Languages ย  Go
๐ŸŒ
Jyotiprakash's Blog
blog.jyotiprakash.org โ€บ file-compression-and-decompression-in-c-using-zlib
File compression and decompression in C using ZLib
December 31, 2023 - To create a C program that uses Zlib to compress or decompress a file based on command-line arguments, you need to follow these steps: Install Zlib for Development on Ubuntu: Open a terminal and run the following command to install Zlib development...
๐ŸŒ
Ubuntu Manpages
manpages.ubuntu.com โ€บ jammy โ€บ man(3)
Ubuntu Manpage: zlib - compression/decompression library
The zlib library is a general purpose data compression library. The code is thread safe, assuming that the standard library functions used are thread safe, such as memory allocation routines. It provides in-memory compression and decompression functions, including integrity checks of the uncompressed data.
๐ŸŒ
Ubuntu
manpages.ubuntu.com โ€บ trusty โ€บ man(1)
Ubuntu Manpage: zlib-flate - raw zlib compression program
The zlib-flate program reads from standard input and writes to standard output either compressing or uncompressing its input using raw zlib compression. It can be used to uncompress or compress raw PDF streams or other data that is compressed with raw zlib compression.
๐ŸŒ
Ubuntu Manpages
manpages.ubuntu.com โ€บ manpages โ€บ focal โ€บ man1 โ€บ zlib_decompress.1.html
Ubuntu Manpage: zlib_decompress - decompress mysqlpump ZLIB-compressed output
output_file Example: mysqlpump --compress-output=ZLIB > dump.zlib zlib_decompress dump.zlib dump.txt To see a help message, invoke zlib_decompress with no arguments. To decompress mysqlpump LZ4-compressed output, use lz4_decompress.
Find elsewhere
๐ŸŒ
LinuxVox
linuxvox.com โ€บ blog โ€บ zlib-ubuntu
Zlib on Ubuntu: A Comprehensive Guide โ€” linuxvox.com
... Zlib is a compression library that implements the deflate compression algorithm, which is a combination of LZ77 and Huffman coding. It provides a simple API for compressing and decompressing data streams.
๐ŸŒ
Linuxbase
refspecs.linuxbase.org โ€บ LSB_3.0.0 โ€บ LSB-Core-generic โ€บ LSB-Core-generic โ€บ zlib-uncompress-1.html
uncompress - Linux Foundation Referenced Specifications
int uncompress(Bytef * dest, uLongf * destLen, const Bytef * source, uLong sourceLen); ยท The uncompress() function shall attempt to uncompress sourceLen bytes of data in the buffer source, placing the result in the buffer dest
๐ŸŒ
Ubuntu
manpages.ubuntu.com โ€บ manpages โ€บ noble โ€บ man3 โ€บ zlib.3erl.html
Ubuntu Manpage: zlib - zlib compression interface.
sync, and the compression state is reset so that decompression can restart from this point if previous compressed data has been damaged or if random access is desired. Using ยท full too often can seriously degrade the compression. If ... deflateInit if all compression is to be done in one step. Example: zlib:deflateInit(Z), B1 = zlib:deflate(Z,Data), B2 = zlib:deflate(Z,<< >>,finish), zlib:deflateEnd(Z), list_to_binary([B1,B2]) deflateEnd(Z) -> ok Types: Z = zstream() Ends the deflate session and cleans all data used.
๐ŸŒ
Stack Overflow
stackoverflow.com โ€บ questions โ€บ 69105129 โ€บ how-to-decompress-deflate-zlib-data-rfc1951
red lang - How to decompress/deflate zlib data [rfc1951]? - Stack Overflow
I am looking for decompressing data according to the deflate compression mechanism [rfc1951]. The linux command for this mechanism is: zlib-flate -uncompress I try the Red command decompress with
๐ŸŒ
TREND OCEANS
trendoceans.com โ€บ home โ€บ blog โ€บ topic โ€บ troubleshoot โ€บ how to solve zipimport.zipimporterror: canโ€™t decompress data; zlib not available
How to Solve Zipimport.ZipImportError: Can't Decompress Data; Zlib Not Available - TREND OCEANS
June 19, 2023 - $ sudo apt install install ... base-devel // ArchLinux/Manjaro ยท A zlib is a library that provides the function to compress and decompress files during the program compilation....
๐ŸŒ
SysTutorials
systutorials.com โ€บ docs โ€บ linux โ€บ man โ€บ n-zlib
zlib: compression and decompression operations - Linux Manuals (n)
Pushes a compressing or decompressing transformation onto the channel channel. The transformation can be removed again with chan pop. The mode argument determines what type of transformation is pushed; the following are supported: ... The ...
๐ŸŒ
LinuxVox
linuxvox.com โ€บ blog โ€บ install-zlib-ubuntu
Installing zlib on Ubuntu: A Comprehensive Guide โ€” linuxvox.com
This blog post will guide you through the process of installing zlib on Ubuntu, covering fundamental concepts, usage methods, common practices, and best practices. ... zlib is a library that provides in-memory compression and decompression functions using the DEFLATE algorithm.
๐ŸŒ
zlib
zlib.net
zlib Home Site
Jean-loup is also the primary author ... Zip; Mark is also the author of gzip's and UnZip's main decompression routines and was the original author of Zip. Not surprisingly, the compression algorithm used in zlib is essentially the same as that in gzip and Zip, namely, the `deflate' ...