為什麼 apt-get 無法安裝任何應用程式?

為什麼 apt-get 無法安裝任何應用程式?

當嘗試使用 apt-get 安裝應用程式時,我總是得到

/bin/sh: /usr/sbin/dpkg-preconfigure: not found

例如:

$sudo apt-get install libssl-dev  
[sudo] password for camino:   
Reading package lists... Done  
Building dependency tree         
Reading state information... Done  
 ....

Do you want to continue [Y/n]? y  
WARNING: The following packages cannot be authenticated!  
  libssl-dev libssl0.9.8  
Install these packages without verification [y/N]? y  


/bin/sh: /usr/sbin/dpkg-preconfigure: not found  
Setting up debconf (1.5.35+maemo3+0m6) ...  
exec: 19: /usr/share/debconf/frontend: not found  
dpkg: error processing debconf (--configure):    
 subprocess installed post-installation script returned error exit status 2  
Errors were encountered while processing:  
 debconf  


$sudo dpkg-reconfigure libssl-dev  
sudo: unable to execute /usr/sbin/dpkg-reconfigure: No such file or directory  

$ls /usr/sbin/dpkg-reconfigure  
/usr/sbin/dpkg-reconfigure  

$which dpkg-reconfigure  
/usr/sbin/dpkg-reconfigure  

$dpkg-reconfigure  
bash: /usr/sbin/dpkg-reconfigure: /usr/bin/perl.real: bad interpreter: No such file or directory

有什麼建議麼?

答案1

您的系統太糟糕了,我建議您重新安裝。

理由:如果這些非常破碎的東西只是冰山一角,那麼這個系統很快就會帶給你很多問題。使其處於已知狀態 - 最簡單的方法是全新安裝。

(然後不要再做你做過的事情)。

答案2

bash:/usr/sbin/dpkg-reconfigure:/usr/bin/perl.real:錯誤的解釋器:沒有這樣的檔案或目錄

perl.real?有沒有搞錯?有些東西或某人修改了你的文件,/usr/sbin/dpkg-reconfigure使其包含錯誤的 Perl 路徑。

/usr/sbin/dpkg-reconfigure例如,使用您最喜歡的文字編輯器和 sudo編輯文件,sudo nano -w /usr/sbin/dpkg-reconfigure並將文件的開頭更改為

#!/usr/bin/perl.real -w

#!/usr/bin/perl -w

答案3

我使用 sudo apt install --reinstall po-debconf et voilà 解決了這個問題,在該命令之後我可以安裝新程式

(Ubuntu 14.04 32 位元 - 在 Eee PC 1000HE 上運行)

答案4

除非你只是弄亂了你的 PATH 變量,否則你可能已經以某種方式刪除了一個重要的程式。

- 你的 $PATH 變數說什麼? - 自 apt-get 上次工作以來您是否刪除過任何目錄?

相關內容