Ubuntu – Samba does not launch after upgrading to 16.04

16.04sambaupgrade

I have upgraded smoothly to 16.04, everything seems ok except samba not starting:

$ sudo /etc/init.d/smbd status
● smbd.service - LSB: start Samba SMB/CIFS daemon (smbd)
   Loaded: loaded (/etc/init.d/smbd; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2016-04-25 21:43:03 EET; 23min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1954 ExecStart=/etc/init.d/smbd start (code=exited, status=1/FAILURE)

Apr 25 21:43:02 home systemd[1]: Starting LSB: start Samba SMB/CIFS daemon (smbd)...
Apr 25 21:43:03 home smbd[1954]:  * Starting SMB/CIFS daemon smbd
Apr 25 21:43:03 home smbd[1954]:    ...fail!
Apr 25 21:43:03 home systemd[1]: smbd.service: Control process exited, code=exited status=1
Apr 25 21:43:03 home systemd[1]: Failed to start LSB: start Samba SMB/CIFS daemon (smbd).
Apr 25 21:43:03 home systemd[1]: smbd.service: Unit entered failed state.
Apr 25 21:43:03 home systemd[1]: smbd.service: Failed with result 'exit-code'.

I did not alter any configuration after the upgrade, I just need to maintain the 15.10 functionalities. I have done several reboots with no luck.

Update1:
I purged samba and tried to re-install, but got the following error:

Errors were encountered while processing:
 samba
E: Sub-process /usr/bin/dpkg returned an error code (1)
Failed to perform requested operation on package.  Trying to recover:
Setting up samba (2:4.3.8+dfsg-0ubuntu1) ...
Job for smbd.service failed because the control process exited with error code. See "systemctl status smbd.service" and "journalctl -xe" for details.
invoke-rc.d: initscript smbd, action "start" failed.
dpkg: error processing package samba (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Errors were encountered while processing:
 samba

Looks like the 16.04 package has a bad post-installation script?

Any tips/tricks are appreciated.

Best Answer

I had the exact problem after upgrading to 16.04, first showed many errors as yours, something like:

dpkg: error processing package samba (--configure)

After I changed software sources to ubuntu main server, I can reinstall samba and the following commands without error:

sudo /etc/init.d/smbd status
sudo apt-get install libnss-winbind* libpam-winbind* samba* winbind*

Because the uninstall of samba was --purge, my old smb.conf was removed, it generated a new one, I think after I edit it, it won't be a problem.

Related Question