Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

===================================================

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

share|improve this question

migrated from stackoverflow.com Oct 27 '10 at 3:02

This question came from our site for professional and enthusiast programmers.

    
What the heck did you do to get your system into this state? There are protections against uninstalling core system packages. –  ephemient Oct 27 '10 at 3:20
    
sorry,I cannot remember whether I have deleted something or not –  camino Oct 27 '10 at 6:18

5 Answers 5

up vote 1 down vote accepted

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).

share|improve this answer
    
If somebody knowledgeable had direct access to the machine in question, they might be able to wget and ar and tar (or maybe dpkg-deb still works, who knows) the system back into a usable state, but over SU… the easiest thing to do is almost certainly reinstall. –  ephemient Oct 27 '10 at 22:42
    
@ephemient - how would you determine when you are done fixing things? –  Thorbjørn Ravn Andersen Oct 28 '10 at 6:41

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

share|improve this answer
    
thank you!,the perl issue has been fixed,but the apt-get still can not work –  camino Oct 27 '10 at 7:25
    
... and in what way it fails? Please update your original question and be more verbose. –  Janne Pikkarainen Oct 27 '10 at 7:56

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?

share|improve this answer
    
$echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr –  camino Oct 27 '10 at 6:15

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

share|improve this answer
    
$sudo dpkg-reconfigure libssl-dev sudo: unable to execute /usr/sbin/dpkg-reconfigure: No such file or directory but in fact /usr/sbin/dpkg-reconfigure do exist $ls /usr/sbin/dpkg-reconfigure /usr/sbin/dpkg-reconfigure –  camino Oct 27 '10 at 6:17

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.