Samba-common-bin installed post-installation script fails with error 2

Bug #526418 reported by Mike Molnar
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
samba (Ubuntu)
Invalid
Low
Unassigned

Bug Description

Binary package hint: samba

samba-common-bin upgrade fails with this error message:

sudo dpkg --configure -a
Setting up samba-common-bin (2:3.4.0-3ubuntu5.5) ...
update-alternatives: error: /var/lib/dpkg/alternatives/nmblookup corrupt: invalid status
dpkg: error processing samba-common-bin (--configure):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 samba-common-bin

No errors reported in /var/log/syslog

ProblemType: Package
AptOrdering:
 squid-common: Install
 squid: Install
 samba-common-bin: Configure
 squid-common: Configure
 squid: Configure
Architecture: i386
Date: Wed Feb 17 14:19:03 2010
DistroRelease: Ubuntu 9.10
ErrorMessage: subprocess installed post-installation script returned error exit status 2
Package: samba-common-bin 2:3.4.0-3ubuntu5.4
ProcVersionSignature: Ubuntu 2.6.31-20.57-generic
SourcePackage: samba
Title: package samba-common-bin 2:3.4.0-3ubuntu5.4 failed to install/upgrade: subprocess installed post-installation script returned error exit status 2
Uname: Linux 2.6.31-20-generic i686

Revision history for this message
Mike Molnar (5-launchpad-itgeekery-com) wrote :
Revision history for this message
Thierry Carrez (ttx) wrote :

Setting up samba-common-bin (2:3.4.0-3ubuntu5.4) ...
update-alternatives: error: /var/lib/dpkg/alternatives/nmblookup corrupt: invalid status
dpkg: error processing samba-common-bin (--configure):
 subprocess installed post-installation script returned error exit status 2

Looks like something/someone broke the nmblookup alternatives setting. I'd recommend purging the samba (including samba-common) packages, clearing /var/lib/dpkg/alternatives/nmblookup and try to reinstall samba.

Changed in samba (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Mike Molnar (5-launchpad-itgeekery-com) wrote : Re: [Bug 526418] Re: Samba-common-bin installed post-installation script fails with error 2

On Thu, 2010-02-25 at 09:02 +0000, Thierry Carrez wrote:
> Setting up samba-common-bin (2:3.4.0-3ubuntu5.4) ...
> update-alternatives: error: /var/lib/dpkg/alternatives/nmblookup corrupt: invalid status
> dpkg: error processing samba-common-bin (--configure):
> subprocess installed post-installation script returned error exit status 2
>
> Looks like something/someone broke the nmblookup alternatives setting.
> I'd recommend purging the samba (including samba-common) packages,
> clearing /var/lib/dpkg/alternatives/nmblookup and try to reinstall
> samba.
>
> ** Changed in: samba (Ubuntu)
> Importance: Undecided => Low
>
> ** Changed in: samba (Ubuntu)
> Status: New => Incomplete
>

Thanks for the quick response.

Following your recommendations, I purged the packages using apt-get
purge, then renamed /var/lib/dpkg/alternatives/nmblookup.

Execution of: [sudo dpkg --configure -a] resulted in:

Setting up samba-common-bin (2:3.4.0-3ubuntu5.5) ...
update-alternatives: error: /var/lib/dpkg/alternatives/net corrupt:
invalid status
dpkg: error processing samba-common-bin (--configure):
 subprocess installed post-installation script returned error exit
status 2
Errors were encountered while processing:
 samba-common-bin
E: Sub-process /usr/bin/dpkg returned an error code (1)

I renamed /var/lib/dpkg/alternatives/net.

Execution of: [sudo dpkg --configure -a] resulted in:

Setting up samba-common-bin (2:3.4.0-3ubuntu5.5) ...
Use of uninitialized value in string ne at /usr/sbin/update-alternatives
line 260.
update-alternatives: warning: /etc/alternatives/net has been changed
(manually or by a script). Switching to manual updates only.
update-alternatives: error: /var/lib/dpkg/alternatives/testparm corrupt:
invalid status
dpkg: error processing samba-common-bin (--configure):
 subprocess installed post-installation script returned error exit
status 2
Errors were encountered while processing:
 samba-common-bin

I renamed /var/lib/dpkg/alternatives/testparm.

Execution of: [sudo dpkg --configure -a] resulted in:

Setting up samba-common-bin (2:3.4.0-3ubuntu5.5) ...
Use of uninitialized value in string ne at /usr/sbin/update-alternatives
line 260.
update-alternatives: warning: /etc/alternatives/testparm has been
changed (manually or by a script). Switching to manual updates only.

However, at that point, it appeared as though samba-common-bin was able
to configure correctly. I will monitor for functionality and report any
additional errors.

Revision history for this message
Thierry Carrez (ttx) wrote :

Yes, I don't exactly know whart broke your alternatives here, which created the problem in the first place. Anything specific you might have done, like trying out samba4 packages ?

Closing as invalid, please reopen if you can reproduce in normal usage.

Changed in samba (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
Mike Molnar (5-launchpad-itgeekery-com) wrote :

On Fri, 2010-02-26 at 07:41 +0000, Thierry Carrez wrote:
> Yes, I don't exactly know whart broke your alternatives here, which
> created the problem in the first place. Anything specific you might have
> done, like trying out samba4 packages ?

Nothing out of the ordinary, and nothing I can think of related to
samba. I'm running on some older hardware, and since 8.04, I have
upgraded rather than perform clean installs. That's the only thing that
occurs to me right now.

<shrug> Thanks for the assist, though. Much appreciated.

Revision history for this message
Jim MacKenzie (jim-photojim) wrote :

I had an identical problem on a Karmic laptop. The system is prone to overheating and shut down automatically during an update (likely while installing a samba update). I got the same errors.

What I did to solve the problem was to copy the following files from a working Ubuntu system (I used my Karmic server):

/var/lib/dpkg/alternatives/nmblookup
./net
./testparm

(I figured this out by fixing one, then trying to aptitude safe-upgrade, and following the next complaint :) ).

Once I replaced all three, samba properly installed and the problem disappeared.

The files contained text garbage unrelated to the original file contents. It was some sort of a disk corruption issue, likely caused by the abrupt powerdown, but the fix was a little unintuitive.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.