[ Content contribution] deepin安装deb文件报解压错误, control.tar.zst 使用了未知的压缩
Tofloor
poster avatar
leego
deepin
2023-09-15 05:28
Author

安装deb文件报错:

sudo dpkg -i prettyzoo_2.1.1_amd64.deb

dpkg-deb: 错误: 归档 prettyzoo_2.1.1_amd64.deb 对成员 control.tar.zst 使用了未知的压缩,放弃操作

dpkg: 处理归档 prettyzoo_2.1.1_amd64.deb (--install)时出错:

dpkg-deb --control 子进程返回错误状态 2

在处理时有错误发生:

prettyzoo_2.1.1_amd64.deb

解决办法:

安装zstd

sudo apt install zstd

创建文件:

touch installDeb.sh

增加文件执行权限:

chmod +x installDeb.sh

复制下列内容到installDeb.sh并保存

#!/bin/bash

suffix=".deb"

if [[ ! -n "$1"  ]]; then
    echo 'deb file must not be empty!'
    exit
fi
if [[ "$1" != *"$suffix"  ]]; then
    echo 'file type must be deb!'
    exit
fi
echo "Extract $1 from the archive"
ar x $1
echo "Uncompress zstd $1 an re-compress them using xz"
zstd -d < control.tar.zst | xz > control.tar.xz
zstd -d < data.tar.zst | xz > data.tar.xz
echo "Re-create the Debian package in /tmp/$1"
ar -m -c -a sdsd /tmp/$1 debian-binary control.tar.xz data.tar.xz
echo 'Clean up'
rm debian-binary control.tar.xz data.tar.xz control.tar.zst data.tar.zst

echo "install $1"
sudo apt install /tmp/$1

执行installDeb.sh xxx.deb(deb文件使用相对路径)

~/installDeb.sh prettyzoo_2.1.1_amd64.deb
Extract prettyzoo_2.1.1_amd64.deb from the archive
Uncompress zstd prettyzoo_2.1.1_amd64.deb an re-compress them using xz
Re-create the Debian package in /tmp/prettyzoo_2.1.1_amd64.deb
Clean up
install prettyzoo_2.1.1_amd64.deb
请输入密码:
验证成功
正在读取软件包列表... 完成
正在分析软件包的依赖关系树   
正在读取状态信息... 完成   
注意,选中 'prettyzoo' 而非 '/tmp/prettyzoo_2.1.1_amd64.deb'
prettyzoo 已经是最新版 (2.1.1)。

安装完成

Reply Favorite View the author
All Replies
阿尼樱奈奈
Moderator
2023-09-15 05:54
#1

V23好像支持解压zst包了

Reply View the author
神末shenmo
deepin
Spark-App
2023-09-15 06:03
#2
Reply View the author
兆兆嘟嘟嘟
deepin
2023-09-16 09:17
#3

这个是Ubuntu标准的压缩格式,非Ubuntu的deb发行版本来就不支持。可以自己解压重新打包。

Reply View the author