samba fails to upgrade due to post-installation script

Bug #37027 reported by Nafallo Bjälevik
146
This bug affects 9 people
Affects Status Importance Assigned to Milestone
samba (Baltix)
Invalid
Undecided
Unassigned
samba (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Setting up samba (3.0.21c-1ubuntu1) ...
dpkg: error processing samba (--configure):
 subprocess post-installation script returned error exit status 10
Errors were encountered while processing:
 samba
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up samba (3.0.21c-1ubuntu1) ...
dpkg: error processing samba (--configure):
 subprocess post-installation script returned error exit status 10
Errors were encountered while processing:
 samba
Press return to continue.

Using aptitude on i386.

Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

Work fine here.
Try :
sudo apt-get clean
sudo apt-get remove --purge samba
sudo apt-get install samba

Changed in samba:
status: Unconfirmed → Needs Info
Revision history for this message
Nafallo Bjälevik (nafallo) wrote : Re: [Bug 37027] Fails to install

nafallo@ogre:~ $ sudo apt-get clean
Password:
nafallo@ogre:~ $ sudo apt-get remove --purge samba
Reading package lists... Done
Building dependency tree... Done
Package samba is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
nafallo@ogre:~ $ sudo apt-get install samba
Reading package lists... Done
Building dependency tree... Done
Recommended packages:
  smbldap-tools
The following NEW packages will be installed:
  samba
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 2843kB of archives.
After unpacking 7246kB of additional disk space will be used.
Get:1 http://se.archive.ubuntu.com dapper/main samba 3.0.21c-1ubuntu1
[2843kB]
Fetched 2843kB in 13s (213kB/s)
Preconfiguring packages ...
samba failed to preconfigure, with exit status 10
Selecting previously deselected package samba.
(Reading database ... 19661 files and directories currently installed.)
Unpacking samba (from .../samba_3.0.21c-1ubuntu1_i386.deb) ...
Setting up samba (3.0.21c-1ubuntu1) ...
dpkg: error processing samba (--configure):
 subprocess post-installation script returned error exit status 10
Errors were encountered while processing:
 samba
E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote : Re: Fails to install

samba postinst script seems buggy...

change "-e" by "-x" in first line of /var/lib/dpkg/info/samba.postinst
and run it by hand on a console.
All have to been done with root permissions.

Put here the output.

Revision history for this message
Nafallo Bjälevik (nafallo) wrote : Re: [Bug 37027] Fails to install

tis 2006-03-28 klockan 18:30 +0000 skrev VETSEL Patrice:
> change "-e" by "-x" in first line of /var/lib/dpkg/info/samba.postinst
> and run it by hand on a console.
> All have to been done with root permissions.

nafallo@ogre:~ $ sudo /var/lib/dpkg/info/samba.postinst
+ case "$1" in
+ echo 'postinst called with unknown argument `'\'''
postinst called with unknown argument `'
+ exit 0

nafallo@ogre:~ $ sudo /var/lib/dpkg/info/samba.postinst configure
+ case "$1" in
+ . /usr/share/debconf/confmodule
++ '[' '!' '' ']'
++ PERL_DL_NONLAZY=1
++ export PERL_DL_NONLAZY
++ '[' '' ']'
++ exec /usr/share/debconf/frontend /var/lib/dpkg/info/samba.postinst
configure

Setting up samba (3.0.21c-1ubuntu1) ...
+ case "$1" in
+ . /usr/share/debconf/confmodule
++ '[' '!' '' ']'
++ PERL_DL_NONLAZY=1
++ export PERL_DL_NONLAZY
++ '[' '' ']'
++ exec /usr/share/debconf/frontend /var/lib/dpkg/info/samba.postinst
configure ''
dpkg: error processing samba (--configure):
 subprocess post-installation script returned error exit status 10
Errors were encountered while processing:
 samba
E: Sub-process /usr/bin/dpkg returned an error code (1)

Hope this helps.

Revision history for this message
Adam Conrad (adconrad) wrote : Re: Fails to install

Can I see the output of:

DEBCONF_DEBUG=developer sudo dpkg-reconfigure -phigh samba

Revision history for this message
Nafallo Bjälevik (nafallo) wrote :

nafallo@ogre:~ $ DEBCONF_DEBUG=developer sudo dpkg-reconfigure -phigh samba
/usr/sbin/dpkg-reconfigure: samba is broken or not fully installed

Revision history for this message
Adam Conrad (adconrad) wrote :

Right, then don't try to dpkg-reconfigure it, but rather just try to install it again with that environment variable set.

Revision history for this message
Nafallo Bjälevik (nafallo) wrote :

nafallo@ogre:~ $ DEBCONF_DEBUG=developer sudo apt-get install samba
Password:
Reading package lists... Done
Building dependency tree... Done
Recommended packages:
  smbldap-tools
The following NEW packages will be installed:
  samba
0 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.
Need to get 2843kB of archives.
After unpacking 7246kB of additional disk space will be used.
Get:1 http://se.archive.ubuntu.com dapper/main samba 3.0.21c-1ubuntu1 [2843kB]
Fetched 2843kB in 19s (147kB/s)
Preconfiguring packages ...
debconf (developer): starting /tmp/samba.config.190021 configure
debconf (developer): <-- TITLE Samba Server
debconf (developer): --> 0
debconf (developer): <-- INPUT medium samba/run_mode
debconf (developer): --> 30 question skipped
debconf (developer): <-- GO
debconf (developer): --> 0 ok
debconf (developer): <-- SET samba/generate_smbpasswd true
debconf (developer): --> 10 samba/generate_smbpasswd doesn't exist
samba failed to preconfigure, with exit status 10
Selecting previously deselected package samba.
(Reading database ... 19704 files and directories currently installed.)
Unpacking samba (from .../samba_3.0.21c-1ubuntu1_i386.deb) ...
Setting up samba (3.0.21c-1ubuntu1) ...
debconf (developer): frontend started
debconf (developer): frontend running, package name is samba
debconf (developer): starting /var/lib/dpkg/info/samba.config configure
debconf (developer): <-- TITLE Samba Server
debconf (developer): --> 0
debconf (developer): <-- INPUT medium samba/run_mode
debconf (developer): --> 30 question skipped
debconf (developer): <-- GO
debconf (developer): --> 0 ok
debconf (developer): <-- SET samba/generate_smbpasswd true
debconf (developer): --> 10 samba/generate_smbpasswd doesn't exist
dpkg: error processing samba (--configure):
 subprocess post-installation script returned error exit status 10
Errors were encountered while processing:
 samba
E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
Phil Bull (philbull) wrote :

I also have this issue, samba 3.0.22-1ubuntu3.

Revision history for this message
Phil Bull (philbull) wrote :

OK, I can fix this by running the following commands from a Terminal:

sudo rm /etc/rc3.d/K09samba
sudo apt-get install samba

It seems that I must have installed a Samba package from a non-Ubuntu repo.

Revision history for this message
Ilmari Vacklin (wolverian) wrote :

Happens here too, latest Dapper, and I have installed Samba only from Ubuntu repositories. I can't update Samba due to this bug.

Revision history for this message
Phil Bull (philbull) wrote :

Do you have the file /etc/rc3.d/K09samba? What happens if you move it to trash?

Revision history for this message
Matthew Carroll (m-tthew) wrote :

Confirmed the above, and fix. I just hit this bug in the process of upgrading a (relatively newly installed ~3 weeks) 5.10 ubuntu install to 6.06 RC using the recommended upgrade process (gksudo "update-manager -d"). It seems the dangling sym link mentioned above was the problem:

matthew@sprite:~$ sudo apt-get install
Password:
Reading package lists... Done
Building dependency tree... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0B of archives.
After unpacking, 0B of additional disk space will be used.
Setting up samba (3.0.22-1ubuntu3) ...
update-rc.d: warning: /etc/rc2.d/K09samba is not a link to ../init.d/samba or /etc/init.d/samba
update-rc.d: warning: /etc/rc3.d/K09samba is not a link to ../init.d/samba or /etc/init.d/samba
invoke-rc.d: dangling symlink: /etc/rc2.d/K09samba
dpkg: error processing samba (--configure):
 subprocess post-installation script returned error exit status 102
Errors were encountered while processing:
 samba
E: Sub-process /usr/bin/dpkg returned an error code (1)

matthew@sprite:~$ ls -l /etc/rc2.d/K09samba /etc/rc3.d/K09samba
lrwxrwxrwx 1 root root 6 2006-05-15 02:28 /etc/rc2.d/K09samba -> /samba
lrwxrwxrwx 1 root root 6 2006-05-15 02:28 /etc/rc3.d/K09samba -> /samba

matthew@sprite:~$ sudo rm /etc/rc2.d/K09samba /etc/rc3.d/K09samba

matthew@sprite:~$ sudo apt-get install
Reading package lists... Done
Building dependency tree... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0B of archives.
After unpacking, 0B of additional disk space will be used.
Setting up samba (3.0.22-1ubuntu3) ...
 * Starting Samba daemons...

...the error initially caused the dapper upgrade process to (seemingly) abort with two dialogue boxes:

subprocess post-installation script returned error exit status 102

installArchives() failed

...however it did then prompt me to reboot.

I had installed samba (through the 'connect to server' wizard) but hadn't done anything more with it than that since installing 5.10. I found myself reverting back to 'reboot and hope for the best' for the first time since using ubuntu :( This was the only error for me in an otherwise smooth upgrade process - hope that helps.

Revision history for this message
Phil Bull (philbull) wrote :

Lots of duplicates. What do you think, Adam?

Changed in samba:
status: Needs Info → Unconfirmed
Revision history for this message
Nafallo Bjälevik (nafallo) wrote :

Anyone with this bug care to see if it's fixed since?

Revision history for this message
Stefano Costa (steko) wrote :

It's not fixed in today's edgy (upgraded from dapper today)

Revision history for this message
Sebastien Bacher (seb128) wrote :

duplicate from bug #9208?

Revision history for this message
Ante Karamatić (ivoks) wrote :

Anyone still having this issue? Stefano?

If yes, check if you have /etc/rc3.d/K09samba.

I've done several breezy->dapper and dapper->edgy upgrades and never hit this bug.

Revision history for this message
Stefano Costa (steko) wrote : Re: [Bug 37027] Re: Fails to install

Hi,
it's been a long time since I submitted this. In the meanwhile, I also went
edgy->feisty and now I'm running debian lenny. I never did other upgrades and,
to be honest, I can't even remember whether I found such a problem or not in
edgy->feisty. Sorry about that.

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Revision history for this message
Henrik Nilsen Omma (henrik) wrote :

No confirmed sightings for a year on this bug. I'm taking the chance to close it. Re-open if I'm wrong. (we will be doing extensive automated tests of Dapper -> Upgrades so we should catch such things then).

Changed in samba:
status: New → Fix Released
status: New → Invalid
Revision history for this message
David Barrabes (david-barrabes) wrote :

sudo apt-get remove --purge samba-common
sudo apt-get remove --purge samba
sudo apt-get install samba

(sorry, my english is so bad and it's dificult to me to explain. I hope you solve yours trouble).

Revision history for this message
the motorman (rdoctors) wrote :

I am using 9.04 . I have a similar problem cannot install or remove samba it is stuck somewhere but not installed I get this when trying to reconfigure :
>>sudo dpkg-reconfigure samba
/usr/sbin/dpkg-reconfigure: samba is broken or not fully installed
The samba seems to be " installed" in usr/ instead ot etc/samba.
How do i do a clean remove and a clean re-install?

Revision history for this message
the motorman (rdoctors) wrote :

The problem is now fixed for me. After purging all Samba I did try an apt-get install samba4. This did not work and it claimed there was a lock somewhere. I checked and Samba was set to load during the startup phase each time I started the computer up. I unlocked and then set samba not to be loaded at start up and it installed samba4. The problems with samba seem to be more my messing with it trying to get my win box printer to work over a LAN than a real bug. For newbies like myself to Unix line commands I humbly suggest that unless you have hours of spare time leave it the experts and install only Ubuntu O/S with it's supplied apps and attributes, we have spoiled by GUI's !

Revision history for this message
sudoaduser (sudoadduser) wrote :

I have this problem to install samba in debian:
Eu tive esse problema ao instalar o samba no Debian:

# apt-get install samba samba-doc samba-common smbclient

"...
Sub-process /usr/bin/dpkg returned an error code (1)"

I kill the problem like this, I believe that It will work on Ubuntu too:
Eu resolví o problema assim, eu acredito que vai funcionar no ubuntu também:

# apt-get remove samba samba-doc samba-common smbclient --purge

# apt-get autoclean

# apt-get autoremove

After this, it works:
depois disso, funcionou:

# apt-get install samba samba-doc samba-common smbclient

Sorry the bad english :D

Try this.
Tenten isso.

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

Other bug subscribers

Remote bug watches

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