Apt-get升级包从32位到不支持的64位 – 为什么以及如何还原?

最近, qtox的存储库必须改变它的域,而新的存储库目前只包含64位版本。 但是,我在15.04 32bit,无法运行任何64位软件。

现在,当我上次运行apt-get upgradeapt-get dist-upgrade (无法准确记住哪一个)时,它还将软件包qtox升级到了存储库中的最新版本。 但这是64位版本! 现在我再也无法启动qtox了:

 $ qtox bash: /usr/bin/qtox: cannot execute binary file: Exec format error $ file $(which qtox) /usr/bin/qtox: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, stripped $ uname -a Linux UbuntuDesktop 3.19.0-26-generic #27-Ubuntu SMP Tue Jul 28 18:26:33 UTC 2015 i686 i686 i686 GNU/Linux 

现在我必须确保apt-get不再安装/升级到任何64位软件包! 不知道这是apt-get的错误,配置错误的包或存储库还是其他任何东西,我需要找出原因并防止再次发生这种情况!

所以我的问题简而言之:

为什么apt-get在仅32位系统上安装64位软件包,以后如何避免这种情况?


更新:

我检查了关于apt-cacheqtox包和直接下载的.deb包的dpkg -I的信息,发现了以下内容。 在我看来,如果他们错误地配置了他们的存储库,因为这些输出看起来像32位包。 它仍然包含旧域。 他们可能忘记更新他们的信息并在apt-get上作弊?

 $ apt-cache show qtox Package: qtox Priority: extra Section: default Installed-Size: 2168 Maintainer: Tox Foundation  Architecture: i386 Version: 1.1~git20150707.cfeeb03-97 Replaces: qtox-unity Depends: libopenal1, libqt5core5a, libqt5gui5, libqt5network5, libqt5widgets5, libqt5xml5, libqt5opengl5, libqt5sql5, libqt5sql5-sqlite, apt-transport-https, libqt5svg5, libappindicator1, libqrencode3, libavformat-ffmpeg56|libavformat-tox56, libavdevice-ffmpeg56|libavdevice-tox56, libavcodec-ffmpeg56|libavcodec-tox56, libavutil-ffmpeg54|libavutil-tox54, libswscale-ffmpeg3|libswscale-tox3 Filename: pool/main/q/qtox/qtox_1.1~git20150707.cfeeb03-97_i386.deb Size: 2217972 MD5sum: bc59427d056da669e52955169266911b SHA1: c6797a04d13d929a068c213913f359719b377735 SHA256: 3405027807573b98a61c33f3aad911f40cf0b0737a95001e951a82937ee5afdd Description: no description given Description-md5: c0af8b65ef8df63b3bfb124d96da1778 Homepage: https://tox.im Vendor: Tox Foundation License: GPLv3+ $ apt-cache policy qtox qtox: Installed: 1.1~git20150707.cfeeb03-97 Candidate: 1.1~git20150707.cfeeb03-97 Version table: *** 1.1~git20150707.cfeeb03-97 0 500 https://pkg.tox.chat/ nightly/main i386 Packages 100 /var/lib/dpkg/status $ dpkg -I qtox_1.1~git20150707.cfeeb03-97_i386.deb new debian package, version 2.0. size 2217972 bytes: control archive=2341 bytes. 677 bytes, 13 lines control 1298 bytes, 17 lines md5sums 2716 bytes, 93 lines * postinst #!/bin/sh Package: qtox Version: 1.1~git20150707.cfeeb03-97 License: GPLv3+ Vendor: Tox Foundation Architecture: i386 Maintainer: Tox Foundation  Installed-Size: 2168 Depends: libopenal1, libqt5core5a, libqt5gui5, libqt5network5, libqt5widgets5, libqt5xml5, libqt5opengl5, libqt5sql5, libqt5sql5-sqlite, apt-transport-https, libqt5svg5, libappindicator1, libqrencode3, libavformat-ffmpeg56|libavformat-tox56, libavdevice-ffmpeg56|libavdevice-tox56, libavcodec-ffmpeg56|libavcodec-tox56, libavutil-ffmpeg54|libavutil-tox54, libswscale-ffmpeg3|libswscale-tox3 Replaces: qtox-unity Section: default Priority: extra Homepage: https://tox.im Description: no description given 

显然,包的名称和元信息都告诉apt-get它是一个32位的包,但这是由维护者错误地设置的。

在他们修复此问题并使用真正的32位软件包更新其存储库之前,我使用以下脚本来validation软件包的真实体系结构:

 #! /bin/bash dir=$(mktemp -d) debfile="*_i386.deb" cd "$dir" echo "Downloading package..." wget https://pkg.tox.chat/pool/main/q/qtox/ -r -l 1 -nd -A "$debfile" -q dpkg -x $debfile "$dir" printf "\n%s\n\n" $debfile dpkg --info $debfile | \ awk '/Architecture/ {printf "defined dpkg architecture is:\t%s\n", $2}' find "$dir" -type f -exec file -b {} \; | \ sort -u | \ awk '/ELF/ {printf "real executable format is: \t\t%s\n", $0}' rm -rf "$dir" exit 0 

(部分剧本来自AB的答案。)

我把它保存为~/bin/qtoxtest.sh并使用chmod +x ~/bin/qtoxtest.sh使其可执行。

该脚本当前提供以下示例输出,它告诉我们仍未正确声明包:

 $ qtoxtest.sh Downloading package... qtox_1.1~git20150707.cfeeb03-97_i386.deb defined dpkg architecture is: i386 real executable format is: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, stripped