It seems the problem is in samba's package postinst script - it returns an error if samba daemon can't be started (for example if /etc/samba/smb.conf file is incorrect or is removed):
tomas@mazius:~$ sudo rm /etc/samba/smb.conf
tomas@mazius:~$ sudo dpkg -i /var/cache/apt/archives/samba_3.0.22-1ubuntu4.1_i386.deb
Selecting previously deselected package samba.
(Reading database ... 156493 files and directories currently installed.)
Unpacking samba (from .../samba_3.0.22-1ubuntu4.1_i386.deb) ...
Setting up samba (3.0.22-1ubuntu4.1) ...
Generating /etc/default/samba...
* Starting Samba daemons... [fail]
invoke-rc.d: initscript samba, action "start" failed.
dpkg: error processing samba (--install):
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
samba
tomas@mazius:~$
Solution is return only warning "Samba daemon can't be started, please check your samba configuration" instead of returning error exit status 1
Btw, /etc/samba/smb.conf file is the config file of another package - samba-common, so, AFAIK, we are not following to the packaging policy when postinst script assumes, that we should have correct config file from another package.
It seems the problem is in samba's package postinst script - it returns an error if samba daemon can't be started (for example if /etc/samba/smb.conf file is incorrect or is removed):
tomas@mazius:~$ sudo rm /etc/samba/smb.conf apt/archives/ samba_3. 0.22-1ubuntu4. 1_i386. deb 3.0.22- 1ubuntu4. 1_i386. deb) ... samba.. .
tomas@mazius:~$ sudo dpkg -i /var/cache/
Selecting previously deselected package samba.
(Reading database ... 156493 files and directories currently installed.)
Unpacking samba (from .../samba_
Setting up samba (3.0.22-1ubuntu4.1) ...
Generating /etc/default/
* Starting Samba daemons... [fail]
invoke-rc.d: initscript samba, action "start" failed.
dpkg: error processing samba (--install):
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
samba
tomas@mazius:~$
Solution is return only warning "Samba daemon can't be started, please check your samba configuration" instead of returning error exit status 1
Btw, /etc/samba/smb.conf file is the config file of another package - samba-common, so, AFAIK, we are not following to the packaging policy when postinst script assumes, that we should have correct config file from another package.