Changing the compression type of a Debian package
When building a Debian package on a recent Ubuntu system it is quite likely that your package will be built with zstd compression.
$ ar t foo.deb
debian-binary
control.tar.zst
data.tar.zst
This can cause problems if you try to install the package on a Debian system, as zstd is currently not supported by dpkg in Debian.
$ dpkg -c foo.deb
dpkg-deb: error: archive 'foo.deb' uses unknown compression for member 'control.tar.zst', giving up
You will have to unpack the deb and package it again using a different (older) compression type.
$ dpkg-deb -x foo.deb tmp
$ dpkg-deb -e foo.deb tmp/DEBIAN
$ dpkg-deb -Zgzip -b tmp foo2.deb
dpkg-deb: building package 'foo' in 'foo2.deb'.
The package is now compressed with an older compression type and you should be able to install it, even on older Debian systems.
$ ar t foo2.deb
debian-binary
control.tar.gz
data.tar.gz