这可能听起来很奇怪,但我偶然通过以下命令从我的 kali linux 中删除了 apt|:-
apt get autoremove apt
然后我尝试使用以下命令重新安装它:-
sudo dpkg -i apt_1.4.11_amd64.deb
但收到错误:-
(Reading database ... 499865 files and directories currently installed.)
Preparing to unpack apt_1.4.11_amd64.deb ...
Unpacking apt (1.4.11) ...
dpkg: dependency problems prevent configuration of apt:
libapt-pkg6.0:amd64 (2.2.4) breaks apt (<< 1.6~) and is installed.
Version of apt to be configured is 1.4.11.
libapt-pkg5.0:amd64 (1.8.4) breaks apt (<< 1.6~) and is installed.
Version of apt to be configured is 1.4.11.
dpkg: error processing package apt (--install):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.31-12) ...
Processing triggers for kali-menu (2021.4.2) ...
Processing triggers for man-db (2.9.4-2) ...
Errors were encountered while processing:
apt
请帮忙
编辑
刚刚发现我需要 apt 版本接近 1.6 左右才能满足依赖性。如果有人可以向我提供任何链接,那么我将非常感激
答案1
您需要从这里下载正确的版本http://http.kali.org/kali/pool/main/a/apt/
wget http://http.kali.org/kali/pool/main/a/apt/apt_2.3.11_amd64.deb
sudo dpkg -i apt_2.3.11_amd64.deb
答案2
嘿,谢谢大家的想法,我已经解决了。也得到了永远不要把事情搞砸的教训。
我只需要下载之前安装的 apt 版本,因为它已经编写好了(<< 1.6~)。我回来了。
wget http://old.kali.org/kali/pool/main/a/apt/apt_1.6.3_amd64.deb
sudo dpkg -i apt_1.6.3_amd64.deb
唷。感谢大家