why apt-get cannot install any application?

by camino   Last Updated May 18, 2015 23:00 PM

when trying to install application using apt-get, I always get

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

for example:

$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

Any suggestions?



Answers 7


Unless you only messed up your PATH variable, you may have somehow deleted an important program.

-What does your $PATH variable say? -Have you deleted any directories since apt-get has last worked?

user53654
user53654
October 27, 2010 04:38 AM

try sudo aptitude remove -> sudo aptitude update --> and then try to intall again sudo aptitude install libssl-dev and sudo dpkg-reconfigure libssl-dev

shahjapan
shahjapan
October 27, 2010 05:10 AM

I suspect their may be something wrong with apt or dpkg-config or possible your bash session.

Try running this because it probably can't hurt

sudo su -      (this lets you become root and uses its settings)

apt-get update && sudo apt-get update && sudo aptitude full-upgrade

exit           (get out of root)

The two apt-get updates are intentional. If there is a problem with one, the second run may fix the first run. You can also replace full-upgrade with safe-upgrade if you don't want to clean unused packages.

wag2639
wag2639
October 27, 2010 07:07 AM

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

perl.real? What the heck? Something or someone has modified your /usr/sbin/dpkg-reconfigure to contain a wrong path to Perl.

Edit the /usr/sbin/dpkg-reconfigure with your favourite text editor and sudo, for example sudo nano -w /usr/sbin/dpkg-reconfigure and change the beginning of the file from

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

to

#!/usr/bin/perl -w

Janne Pikkarainen
Janne Pikkarainen
October 27, 2010 07:14 AM

Your system is so broken that I will recommend a fresh installation.

Rationale: If these very broken things are just the tip of the iceberg then this system will give you a LOT of problems in time to come. Get it in a known state - the easiest way to do so is with a fresh install.

(and then don't do the things you did, again).

Thorbjørn Ravn Andersen
Thorbjørn Ravn Andersen
October 27, 2010 07:43 AM

Thanks all .

the issue has been fixed ,

I use dpkg to show info about debconf

$dpkg -l |grep debconf

ri  debconf        1.5.35+maemo3+0m6               Debian configuration management system  
ii  debconf-i18n   1.5.35+maemo3+0m6       full internationalization support for debcon   
ii  po-debconf     1.0.16                      tool for managing templates file translation  
ii  ssl-cert       1.0.23ubuntu2             simple debconf wrapper for OpenSSL  

it is very strange that debconf is maemo , so I copy debconf and frontend from other's ubuntu machine,
it works now!
but dpkg -l still show it was maemo.

Thanks

camino
camino
September 05, 2014 00:02 AM

i resolved this using "sudo apt install --reinstall po-debconf" et voilĂ , after that command i can install new programms

Paul Hendriks
Paul Hendriks
May 18, 2015 20:47 PM

Related Questions



How do I find out which package owns a file?

Updated August 30, 2015 00:00 AM


ubuntu: A lot of problems after abort an upgrade

Updated March 26, 2016 08:00 AM

Errors were encountered while processing liblua

Updated September 21, 2016 09:21 AM