Linux

從kali linux中刪除了apt,如何重新安裝?

  • December 7, 2021

這聽起來可能很奇怪,但偶然我通過以下命令從我的 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

請幫忙

編輯

剛剛發現我需要接近 1.6 的 apt 版本來滿足依賴關係。如果有人可以給我任何連結,那麼我將非常感激

嘿,謝謝大家的想法,我整理出來了。也得到了永遠不要把事情搞砸的教訓。

我只需要下載之前安裝的 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                                  

                                                     

呸。感謝大家

您需要從這裡下載正確的版本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

引用自:https://unix.stackexchange.com/questions/680543