Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm having a package management problem:

At some point, I must have interrupted an update or something, because the bluez package has broken. I've tried removing and/or reinstalling, but I get nothing but errors. I'm unable to perform any operations with apt as long as this package is broken.

Output from my attempt to remove the package

$ sudo aptitude remove bluez 
The following packages will be REMOVED:  
  bluez 
The following partially installed packages will be configured:
  dictionaries-common dmsetup grub-pc ifupdown install-info rsyslog 
0 packages upgraded, 0 newly installed, 1 to remove and 235 not upgraded.
Need to get 0 B of archives. After unpacking 1,737 kB will be freed.
dpkg: error processing bluez (--remove): 
 Package is in a very bad inconsistent state - you should
 reinstall it before attempting a removal.
configured to not write apport reports
                                      Errors were encountered while processing:
 bluez
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
Setting up install-info (4.13a.dfsg.1-8) ...
/var/lib/dpkg/info/install-info.postinst: 32: /var/lib/dpkg/info/install-info.postinst: update-info-dir: not found
dpkg: error processing install-info (--configure):
 subprocess installed post-installation script returned error exit status 127
Setting up ifupdown (0.7~alpha5+really0.6.15) ...
/var/lib/dpkg/info/ifupdown.postinst: 122: /var/lib/dpkg/info/ifupdown.postinst: update-rc.d: not found
dpkg: error processing ifupdown (--configure):
 subprocess installed post-installation script returned error exit status 127
Setting up locales (2.13-18) ...
/var/lib/dpkg/info/locales.postinst: 64: /var/lib/dpkg/info/locales.postinst: locale-gen: not found
dpkg: error processing locales (--configure):
 subprocess installed post-installation script returned error exit status 127
Setting up dictionaries-common (1.11.6) ...
/var/lib/dpkg/info/dictionaries-common.postinst: 45: /var/lib/dpkg/info/dictionaries-common.postinst: update-dictcommon-aspell: not found
dpkg: error processing dictionaries-common (--configure):
 subprocess installed post-installation script returned error exit status 127
Setting up grub-pc (1.99-12) ...
/var/lib/dpkg/info/grub-pc.postinst: line 438: grub-mkdevicemap: command not found
/var/lib/dpkg/info/grub-pc.postinst: line 263: grub-probe: command not found
/var/lib/dpkg/info/grub-pc.postinst: line 263: grub-probe: command not found
/var/lib/dpkg/info/grub-pc.postinst: line 263: grub-probe: command not found
/var/lib/dpkg/info/grub-pc.postinst: line 559: grub-install: command not found
/var/lib/dpkg/info/grub-pc.postinst: line 669: update-grub: command not found
dpkg: error processing grub-pc (--configure):
 subprocess installed post-installation script returned error exit status 127
Setting up dmsetup (2:1.02.65-1) ...
/var/lib/dpkg/info/dmsetup.postinst: 8: /var/lib/dpkg/info/dmsetup.postinst: update-initramfs: not found
dpkg: error processing dmsetup (--configure):
 subprocess installed post-installation script returned error exit status 127
Setting up rsyslog (5.8.5-1) ...
/var/lib/dpkg/info/rsyslog.postinst: 45: /var/lib/dpkg/info/rsyslog.postinst: update-rc.d: not found
dpkg: error processing rsyslog (--configure):
 subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
 install-info
 ifupdown
 locales
 dictionaries-common
 grub-pc
 dmsetup
 rsyslog

I'm running Debian testing. Is this problem actually with this particular package, or is it a problem with dpkg? What do I need to do to fix my package manager?

share|improve this question
add comment

4 Answers 4

up vote 2 down vote accepted

I haven't encountered this message before, so I guess it's bluez-specific. Have you tried the reinstall the message is suggesting?

apt-get install --reinstall bluez

You might also try using dpkg to install/configure the bluez package from the apt cache. Look for the bluez package in /var/cache/apt. Install like this (as root):

dpkg -i <bluez debian package>
share|improve this answer
    
I installed the package from the apt cache and apt is working again. dpkg -i bluez_4.96-1_amd64.deb –  virtuallinux Oct 8 '11 at 4:11
add comment

This error usually shows up if the package did not install correctly. What does

dpkg -l bluez

show? This typically happens in two ways

  • The install was interrupted.

  • There is something wrong with the {pre/post}-install bluez script (or similar).

As far as the former goes, are you aware of an interrupted install? If this is the problem, a reinstallation may fix the issue.

If the latter, you should still first try reinstalling. However, as a last resort you may have to manually edit the {pre/post}-{install/remove} scripts, depending on where the problem is, and whether you want to try to get it to install properly, or just want to remove it completely. Usually the problem is that something in the scripts is failing, and causing dpkg to error, so the solution is to edit out that thing. All such scripts are located in /var/lib/dpkg/info. Look for bluez.postinst or similar. NB: If this is the problem, it may be a bug, so please make sure to file a bug report with the Debian Bug Tracking System.

share|improve this answer
add comment

It seems to me that you have several errors here, not just related to the bluez package.

When you run aptitude remove, it goes on to configure several packages, most of them implementing basic system functionality (e.g., grub, ifupdown), which suggests that an update was interrupted or there is some disk/filesystem error that prevented it from completing cleanly.

That is to say, the rest of the packages not updating cleanly is likely a sign of greater trouble. Indeed, the log you posted says:

/var/lib/dpkg/info/install-info.postinst: 32: /var/lib/dpkg/info/install-info.postinst: update-info-dir: not found
dpkg: error processing install-info (--configure):
 subprocess installed post-installation script returned error exit status 127

So, configuration of install-info cannot complete because update-info-dir cannot be found. Note that "not found" in this context might also mean "not executable". Likewise, the other packages fail because these programs cannot be found:

grub-install, grub-mkdevicemap, grub-probe, locale-gen,
update-dictcommon-aspell, update-grub, update-info-dir,
update-initramfs, update-rc.d

On my system, the missing files are installed from these packages:

==================================  =================== 
File location                       Package             
==================================  =================== 
/usr/sbin/update-dictcommon-aspell  dictionaries-common 
/usr/sbin/grub-mkdevicemap          grub-common         
/usr/sbin/grub-probe                grub-common         
/usr/lib/grub-legacy/update-grub    grub-pc             
/usr/sbin/grub-install              grub-pc             
/usr/sbin/update-grub               grub-pc             
/usr/sbin/update-initramfs          initramfs-tools     
/usr/sbin/update-info-dir           install-info        
/usr/sbin/locale-gen                locales             
/usr/sbin/update-rc.d               sysv-rc             

As a first debugging step I would then check that the files actually exist, are readable and are executable.

Next, try running each of those with the --help option: do they run correctly?

If both the above tests complete successfully, you might want to reinstall those packages, starting with sysv-rc, initramfs-tools, grub-pc and grub-common (aptitude reinstall grub-pc grub-common).

When you get that part working, aptitude reinstall bluez should bring bluez back into a sane state, after which you can remove it.

share|improve this answer
add comment

This could be a coincidence, but all the errors have to do with invoking programs in /usr/sbin: update-info-dir, update-rc.d, locale-gen, update-dictcommon-aspell, grub-mkdevicemap, grub-probe, grub-install, update-grub, update-initramfs, update-rc.d, as well as invoke-rc.d from bluez's prerm all live in /usr/sbin.

The first thing to check is whether /usr/sbin in root's PATH, but it's unlikely to be the problem because dpkg normally complains loudly if it isn't. In fact, as of squeeze, dpkg complains loudly if it can't find update-rc.d in the PATH, so it's strange that the rsyslog postinst can't find this executable even though dpkg isn't complaining.

What happens if you run these commands (as root)?

type update-rc.d
ls -l /usr/sbin/update-rc.d
file /usr/sbin/update-rc.d
update-rc.d --help
file /bin/sh

The outcome of these commands may suggest a fix. If you find interesting leads but have trouble figuring out what they mean, please edit your question to add this information. Also report anything “unusual” about your system (SELinux, chroot, a dual-architecture installation, …).

share|improve this answer
add comment

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.