Debian

apt/dpkg 不支持 zst 壓縮

  • September 14, 2021

我正在執行 Debian,即:

# uname -A
Linux martlins2 5.10.0-8-amd64 #1 SMP Debian 5.10.46-4 (2021-08-03) x86_64 GNU/Linux

一段時間以來,我看到一些錯誤,表明某些**包某些部分在執行. 特別是,問題的原因在於:apt update``dpkg

# apt update
(...)
# apt upgrade
(...)
dpkg-deb: error: archive '/var/cache/apt/archives/libdrm-amdgpu1_2.4.107+git2109030500.d201a4~oibaf~i_amd64.deb' uses unknown compression for member 'control.tar.zst', giving up
Traceback (most recent call last):
 File "/usr/share/apt-listchanges/DebianFiles.py", line 124, in readdeb
   output = subprocess.check_output(command)
 File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
   return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
 File "/usr/lib/python3.9/subprocess.py", line 528, in run
   raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['dpkg-deb', '-f', '/var/cache/apt/archives/libdrm-amdgpu1_2.4.107+git2109030500.d201a4~oibaf~i_amd64.deb', 'Package', 'Source', 'Version', 'Architecture', 'Status']' returned non-zero exit status 2.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
 File "/usr/bin/apt-listchanges", line 323, in <module>
   main(config)
 File "/usr/bin/apt-listchanges", line 104, in main
   pkg = DebianFiles.Package(deb)
 File "/usr/share/apt-listchanges/DebianFiles.py", line 358, in __init__
   parser.readdeb(self.path)
 File "/usr/share/apt-listchanges/DebianFiles.py", line 127, in readdeb
   raise RuntimeError(_("Error processing '%(what)s': %(errmsg)s") %
RuntimeError: Error processing '/var/cache/apt/archives/libdrm-amdgpu1_2.4.107+git2109030500.d201a4~oibaf~i_amd64.deb': Command '['dpkg-deb', '-f', '/var/cache/apt/archives/libdrm-amdgpu1_2.4.107+git2109030500.d201a4~oibaf~i_amd64.deb', 'Package', 'Source', 'Version', 'Architecture', 'Status']' returned non-zero exit status 2.

dpkg-deb: error: archive '/tmp/apt-dpkg-install-XiLPN8/01-libdrm-amdgpu1_2.4.107+git2109030500.d201a4~oibaf~i_amd64.deb' uses unknown compression for member 'control.tar
.zst', giving up
dpkg: error processing archive /tmp/apt-dpkg-install-XiLPN8/01-libdrm-amdgpu1_2.4.107+git2109030500.d201a4~oibaf~i_amd64.deb (--unpack):
dpkg-deb --control subprocess returned error exit status 2
(...)
Errors were encountered while processing:
/tmp/apt-dpkg-install-XiLPN8/01-libdrm-amdgpu1_2.4.107+git2109030500.d201a4~oibaf~i_amd64.deb
(...)
E: Sub-process /usr/bin/dpkg returned an error code (1)

為了證明這一點,我dpkg直接執行了命令(簡化):

# dpkg -f /var/cache/apt/archives/libdrm-amdgpu1_2.4.107+git2109030500.d201a4~oibaf~i_amd64.deb 'Package'
dpkg-deb: error: archive '/var/cache/apt/archives/libdrm-amdgpu1_2.4.107+git2109030500.d201a4~oibaf~i_amd64.deb' uses unknown compression for member 'control.tar.zst', giving up

該文件確實使用了這樣的壓縮:

# file /var/cache/apt/archives/libdrm-amdgpu1_2.4.107+git2109030500.d201a4~oibaf~i_amd64.deb
/var/cache/apt/archives/libdrm-amdgpu1_2.4.107+git2109030500.d201a4~oibaf~i_amd64.deb: Debian binary package (format 2.0), with control.tar.zs, data compression zst

我確實已經安裝了zstd軟體包:

# apt search zstd
(...)
libzstd1/stable,stable,now 1.4.8+dfsg-2.1 amd64 [installed,automatic]
 fast lossless compression algorithm
(...)
zstd/stable,stable,now 1.4.8+dfsg-2.1 amd64 [installed]
 fast lossless compression algorithm -- CLI tool

此外,我發現以下 dpkg 錯誤報告:https ://bugs.launchpad.net/ubuntu/+source/dpkg/+bug/1764220 說版本中添加了 zstd 支持1.18.4ubuntu1.7。我的 dpkg 版本是1.20.9

# dpkg --version
Debian 'dpkg' package management program version 1.20.9 (amd64).
(...)

所以這可能不是問題。

我還刪除了d/var/cache/apt/archives/*update && upgraded 的全部內容。沒有幫助。

你有什麼建議嗎?是否有/是否還有其他包裹失去?Debian版本沒有這個功能嗎?是配置問題嗎?有什麼解決方法嗎?

Debian 的dpkg軟體包不支持zstd壓縮

我猜你已經添加了一個 Ubuntu PPA;你不應該在 Debian 中使用它們。

引用自:https://unix.stackexchange.com/questions/669004