yktoo / indicator-sound-switcher

Sound input/output selector indicator for Linux
https://yktoo.com/en/software/sound-switcher-indicator/
GNU General Public License v3.0
365 stars 28 forks source link

DEB install: unknown compression for member 'control.tar.zst' #113

Closed hyunlee1o closed 2 years ago

hyunlee1o commented 2 years ago

Describe the bug I tried to update indicator-sound-switcher but it errored on install.

To Reproduce Basically install the .deb file or sudo apt update

Desktop (please complete the following information):

Indicator log: In order to fetch it, quit the indicator from the menu ("Quit"), open Terminal and start it again as follows:

dpkg-deb: error: el archivo `/var/cache/apt/archives/indicator-sound-switcher_2.3.7-1_all.deb' contiene un miembro de datos `control.tar.zst' ininteligible, abandono
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/indicator-sound-switcher_2.3.7-1_all.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/indicator-sound-switcher_2.3.7-1_all.deb': Command '['dpkg-deb', '-f', '/var/cache/apt/archives/indicator-sound-switcher_2.3.7-1_all.deb', 'Package', 'Source', 'Version', 'Architecture', 'Status']' returned non-zero exit status 2.
dpkg-deb: error: el archivo `/var/cache/apt/archives/indicator-sound-switcher_2.3.7-1_all.deb' contiene un miembro de datos `control.tar.zst' ininteligible, abandono
dpkg: error al procesar el archivo /var/cache/apt/archives/indicator-sound-switcher_2.3.7-1_all.deb (--unpack):
 el subproceso dpkg-deb --control devolvió el código de salida de error 2
Se encontraron errores al procesar:
 /var/cache/apt/archives/indicator-sound-switcher_2.3.7-1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
yktoo commented 2 years ago

Please try installing zstd:

sudo apt-get install zstd

then retry.

hyunlee1o commented 2 years ago

i installed zstd but the result is the same, and the update error message is the same.

yktoo commented 2 years ago

Well I guess this Debian bug needs to be addressed for this to work. zstd compression support has been added to Ubuntu quite a while ago, but not to Debian yet.

hyunlee1o commented 2 years ago

Should i just compile from source?

yktoo commented 2 years ago

By all means, it's always an option. You can also manually repack the .deb:

ar x indicator-sound-switcher_2.3.7-1_all.deb
zstd -d < control.tar.zst | xz > control.tar.xz
zstd -d < data.tar.zst | xz > data.tar.xz
ar -m -c -a sdsd indicator-sound-switcher_repacked.deb debian-binary control.tar.xz data.tar.xz
rm debian-binary control.tar.xz data.tar.xz control.tar.zst data.tar.zst
hyunlee1o commented 2 years ago

Okay, thank you. I installed from source.

goproslowyo commented 2 years ago

Hey @yktoo, after some furious googling of the strange error message with little help beyond the standard --fix-broken I landed on this GitHub issue.

Your response helped me repackage a package I was having trouble with, and so, I wrote a gist so hopefully others encountering the generic error: archive uses unknown compression for member control.tar.zst, giving up can repackage their problem package as well.

Thanks! 🎉

ovhx commented 1 year ago

Instead of manually repacking everything each time you update you can install Ubuntu's dpkg (http://ports.ubuntu.com/pool/main/d/dpkg/) and update normally (remember to do sudo apt-mark hold dpkg). After updating you can reinstall the version of dpkg you had before.

DeeDeeRanged commented 1 year ago

Iinstead of installing ubuntu's dpkg on debian I made a script to avoid such a frankenstein.

#!/bin/bash

DEBPACKAGE="${1%.deb}"

[[ -z "$1" ]] && echo "Usage: $0 <package.deb>" && exit 1

set -e
ar x $DEBPACKAGE.deb
zstd -d < control.tar.zst | xz > control.tar.xz
zstd -d < data.tar.zst | xz > data.tar.xz
ar -m -c -a sdsd "$DEBPACKAGE"_repacked.deb debian-binary control.tar.xz data.tar.xz
rm debian-binary control.tar.xz data.tar.xz control.tar.zst data.tar.zst

As this gives a Debian user a better alternative. You can even add set -x under the bin/bash to see exactly what it is doing and iif you don't need just comment it out.

truekaerf commented 1 year ago

I added the following two lines to the end of DeeDeeRanged's script.

echo "Repack done. Use the following command to install." echo "sudo dpkg -i --force-overwrite ${DEBPACKAGE}_repacked.deb"

tmiland commented 1 year ago

Hello, i couldn't get the above commands to work, so i created a patched dpkg deb package to install on Debian.

Hope someone will find it useful.

jd-apprentice commented 1 year ago

By all means, it's always an option. You can also manually repack the .deb:

ar x indicator-sound-switcher_2.3.7-1_all.deb
zstd -d < control.tar.zst | xz > control.tar.xz
zstd -d < data.tar.zst | xz > data.tar.xz
ar -m -c -a sdsd indicator-sound-switcher_repacked.deb debian-binary control.tar.xz data.tar.xz
rm debian-binary control.tar.xz data.tar.xz control.tar.zst data.tar.zst

Thanks this worked for me <3

Danny3 commented 1 year ago

Iinstead of installing ubuntu's dpkg on debian I made a script to avoid such a frankenstein. #!/bin/bash

DEBPACKAGE="$1"

if [ "$1" = "" ]; then echo echo "Usage: $0 without .deb" echo "Like zstd_repack.sh package_name" echo exit fi

ar x $DEBPACKAGE.deb zstd -d < control.tar.zst | xz > control.tar.xz zstd -d < data.tar.zst | xz > data.tar.xz ar -m -c -a sdsd "$DEBPACKAGE"_repacked.deb debian-binary control.tar.xz data.tar.xz rm debian-binary control.tar.xz data.tar.xz control.tar.zst data.tar.zst

As this gives a Debian user a better alternative. You can even add set -x under the bin/bash to see exactly what it is doing and iif you don't need just comment it out.

With the files from:

https://kernel.ubuntu.com/~kernel-ppa/mainline/v6.2-rc3/

It fails with the third one, like when issuing the command:

./repackage.sh linux-image-unsigned-6.2.0-060200rc3-generic_6.2.0-060200rc3.202301081352_amd64

Giving this output:

./repackage.sh: line 14: control.tar.zst: No such file or directory ./repackage.sh: line 15: data.tar.zst: No such file or directory rm: cannot remove 'control.tar.zst': No such file or directory rm: cannot remove 'data.tar.zst': No such file or directory

Any chance you can fix it?

Thank you!

yktoo commented 1 year ago

@Danny3 AFAIS those DEBs don't use zstd compression, there are just uncompressed .tar files inside.

Also, I'd strongly recommend to add set -e to the script to avoid proceeding after a failed command (will update the comment).