我希望我就在这里,几天前 apt-get 打破了我的 Raspberry Pi Model B rev。2(运行 Openhabian)。我不确定为什么还无法自己修复它。
当我尝试以apt-get update
root 身份运行时,我得到以下输出:
[15:58:05] root@openHABianPi:/home/openhabian# apt-get update
Reading package lists... Done
E: Method http has died unexpectedly!
E: Sub-process http received signal 4.
E: Method /usr/lib/apt/methods/http did not start correctly
E: Method https has died unexpectedly!
E: Sub-process https received signal 4.
E: Method /usr/lib/apt/methods/https did not start correctly
E: Method https has died unexpectedly!
E: Sub-process https received signal 4.
E: Method /usr/lib/apt/methods/https did not start correctly
E: Method https has died unexpectedly!
E: Sub-process https received signal 4.
E: Method /usr/lib/apt/methods/https did not start correctly
E: Method https has died unexpectedly!
E: Sub-process https received signal 4.
E: Method /usr/lib/apt/methods/https did not start correctly
E: Method http has died unexpectedly!
E: Sub-process http received signal 4.
E: Method /usr/lib/apt/methods/http did not start correctly
E: Method http has died unexpectedly!
E: Sub-process http received signal 4.
E: Method /usr/lib/apt/methods/http did not start correctly
E: Failed to fetch http://raspbian.raspberrypi.org/raspbian/dists/stretch/InRelease
E: Failed to fetch https://apt.homegear.eu/Raspbian/stretch/InRelease
E: Failed to fetch https://deb.debian.org/debian/dists/stretch-backports/InRelease
E: Failed to fetch https://mirrordirector.raspbian.org/raspbian/dists/testing/InRelease
E: Failed to fetch https://dl.bintray.com/openhab/apt-repo2/dists/stable/InRelease
E: Failed to fetch http://archive.raspberrypi.org/debian/dists/stretch/InRelease
E: Failed to fetch http://repos.azulsystems.com/debian/dists/stable/InRelease
E: Some index files failed to download. They have been ignored, or old ones used instead.
当我尝试检查/usr/lib/apt/methods/http
(https 是指向它的链接)的版本时,我得到以下输出:
[15:59:05] root@openHABianPi:/home/openhabian# /usr/lib/apt/methods/http
Illegal instruction
我已经apt-transport-https
安装了。我也这样做apt-get autoremove
了,无论包是什么,都可能缺少一些依赖性/usr/lib/apt/methods/http
,据我所知,这甚至是不应该发生的。
谢谢您的帮助!
编辑 1:
[23:11:36] root@openHABianPi:/home/openhabian# dpkg -i apt_1.4.9_armhf.deb
dpkg: warning: downgrading apt from 1.8.0 to 1.4.9
(Reading database ... 47399 files and directories currently installed.)
Preparing to unpack apt_1.4.9_armhf.deb ...
Unpacking apt (1.4.9) over (1.8.0) ...
dpkg: dependency problems prevent configuration of apt:
libapt-pkg5.0:armhf (1.8.0) breaks apt (<< 1.6~) and is installed.
Version of apt to be configured is 1.4.9.
dpkg: error processing package apt (--install):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.28-8) ...
Processing triggers for man-db (2.7.6.1-2) ...
Errors were encountered while processing:
apt
我安装了libapt-pkg5.0_1.4.9_armhf.deb然后能够安装apt_1.4.9_armhf.deb
我仍然遇到 apt-get update0% [Working]
在一个来源冻结的问题,这仍然可能是由不兼容的来源引起的。
编辑 2:
问题是由来自 letsencrypt/certbot-setup 的错误源引起的,我通过删除源、将我的包固定到稳定(对很多包使用“现在”)和基本上通过apt-get dist-upgrade
大量手动检查非常小心。即使安装了 apt-transport-https,您也可能不得不暂时排除 https 源,因为它对我也不起作用(/usr/lib/apt/methods/https
由于依赖关系,调用时出现“非法指令”失败)。
我希望你
dpkg
仍然可以正常工作......在我的 Debian/MX 系统(也基于 Debian stretch)上,该/usr/lib/apt/methods/http
文件是apt
包的一部分,用dpkg -S /usr/lib/apt/methods/http
.浏览可能是您的主要存储库的内容http://raspbian.raspberrypi.org/raspbian/dists/stretch/InRelease并专门查看http://raspbian.raspberrypi.org/raspbian/dists/stretch/main/binary-armhf /Packages(它是 59M)我看到它有
这也与我的版本号相同。所以我猜你的
apt
包裹不知何故搞砸了,也许来自另一个来源的不兼容版本“升级”了它?您可以使用以下方法之一检查您的 apt 版本:apt-cache showpkg apt
apt-cache show apt
如果 apt-cache 仍然有效,或者dpkg -s apt
dpkg-query --show apt
希望它不是 1.4.9,所以你可以尝试安装这个版本。通过存储库浏览更多内容, http: //raspbian.raspberrypi.org/raspbian/pool/main/a/apt/有apt_1.4.9_armhf.deb文件。
[它的镜像列表在这里,还有其他下载链接。]
如果您下载 .deb。文件,并安装它
那应该安装一个希望好的版本的apt。
小心不要再次“升级”apt 到一个可能损坏的版本,我会检查任何候选人的来源
apt-cache policy apt
并可能删除“坏”来源,或者考虑apt
只固定到一个好的来源(参见 参考资料man apt_preferences
)或锁定它的版本。