if TAR_OPTIONS is set to a custom compression utility ( with a few exceptions ) apt fails to install/upgrade/reinstall - it fails processing the tar part of a deb package:
Code: Select all
deb10 ~ # apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
linux-headers-6.1.0-16-amd64 linux-headers-6.1.0-16-common linux-image-6.1.0-16-amd64
Use 'apt autoremove' to remove them.
The following packages will be upgraded:
firefox-esr thunderbird
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 121 MB of archives.
After this operation, 256 kB disk space will be freed.
Do you want to continue? [Y/n]
Get:1 http://security.debian.org/debian-security bookworm-security/main amd64 firefox-esr amd64 115.9.0esr-1~deb12u1 [63.1 MB]
Get:2 http://security.debian.org/debian-security bookworm-security/main amd64 thunderbird amd64 1:115.9.0-1~deb12u1 [58.3 MB]
Fetched 121 MB in 5s (26.1 MB/s)
dpkg-deb (subprocess): decompressing archive '/var/cache/apt/archives/firefox-esr_115.9.0esr-1~deb12u1_amd64.deb' (size=63138364) member 'data.tar': lzma write error: Broken pipe
dpkg-deb: error: <decompress> subprocess returned error exit status 2
dpkg-deb (subprocess): cannot copy archive member from '/var/cache/apt/archives/firefox-esr_115.9.0esr-1~deb12u1_amd64.deb' to decompressor pipe: failed to write (Broken pipe)
dpkg-deb (subprocess): decompressing archive '/var/cache/apt/archives/thunderbird_1%3a115.9.0-1~deb12u1_amd64.deb' (size=58268604) member 'data.tar': lzma write error: Broken pipe
dpkg-deb: error: <decompress> subprocess returned error exit status 2
dpkg-deb (subprocess): cannot copy archive member from '/var/cache/apt/archives/thunderbird_1%3a115.9.0-1~deb12u1_amd64.deb' to decompressor pipe: failed to write (Broken pipe)
Reading changelogs... Done
(Reading database ... 583237 files and directories currently installed.)
Preparing to unpack .../firefox-esr_115.9.0esr-1~deb12u1_amd64.deb ...
Leaving 'diversion of /usr/bin/firefox to /usr/bin/firefox.real by firefox-esr'
Unpacking firefox-esr (115.9.0esr-1~deb12u1) over (115.8.0esr-1~deb12u1) ...
Preparing to unpack .../thunderbird_1%3a115.9.0-1~deb12u1_amd64.deb ...
Unpacking thunderbird (1:115.9.0-1~deb12u1) over (1:115.8.0-1~deb12u1) ...
Setting up thunderbird (1:115.9.0-1~deb12u1) ...
Setting up firefox-esr (115.9.0esr-1~deb12u1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for man-db (2.11.2-2) ...
Processing triggers for mailcap (3.70+nmu1) ...
Processing triggers for desktop-file-utils (0.26-1) ...
deb10 ~ #
un-setting TAR_OPTIONS allows the package to be installed ( or reinstalled, upgraded ) correctly
also, i am setting TAR_OPTIONS in /etc/profile.d/custom.sh and in .bashrc ( which is questionable but should not result in a failure processing lzma )
Code: Select all
export TAR_OPTIONS="--use-compress-program=zstdmt"
it was a challenge to locate the reason for the failures - it is "solved", but imo it is not.
I think that the decompressor should be checked, or set regardless of, or set/unset if the env var exists during or before processing of a deb pkg to prevent it from using an alternate, custom, incompatible decompressor.
edit 23mar2024: I think it applies only to upgrade - i cannot recreate the error during install / reinstall - so far applies only to upgrade - do not want to misrepresent or misinform - will reply shortly - thx