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-reconfigurePerl への間違ったパスが含まれるように変更しました。

お気に入りのテキストエディタとsudoを使って編集し/usr/sbin/dpkg-reconfigure、例えばsudo nano -w /usr/sbin/dpkg-reconfigureファイルの先頭を次のように変更します。

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

#!/usr/bin/perl -w

答え3

私はet voilàを使用してこれを解決しました sudo apt install --reinstall po-debconf 。そのコマンドを実行すると、新しいプログラムをインストールできます。

(Ubuntu 14.04 32ビット - Eee PC 1000HEで実行)

答え4

PATH 変数を台無しにしただけではないにしても、何らかの理由で重要なプログラムを削除してしまった可能性があります。

- $PATH 変数には何と書かれていますか? - apt-get が最後に動作してからディレクトリを削除しましたか?

関連情報