When I tried to install Samba4 on Ubuntu 12.04, I was getting the following error:
root@samba4:~# apt-get install samba4
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
phpldapadmin samba-gtk swat2
The following NEW packages will be installed:
samba4
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1,662 kB of archives.
After this operation, 11.4 MB of additional disk space will be used.
Preconfiguring packages ...
Traceback (most recent call last):
File "/usr/bin/samba-tool", line 26, in
from samba.netcmd.main import cmd_sambatool
File "/usr/lib/python2.7/dist-packages/samba/netcmd/main.py", line 24, in
from samba.netcmd.delegation import cmd_delegation
File "/usr/lib/python2.7/dist-packages/samba/netcmd/delegation.py", line 29, in
from samba.netcmd.common import _get_user_realm_domain
File "/usr/lib/python2.7/dist-packages/samba/netcmd/common.py", line 24, in
from samba.net import Net
ImportError: libkdc-policy.so: cannot open shared object file: No such file or directory
Selecting previously unselected package samba4.
(Reading database ... 15986 files and directories currently installed.)
Unpacking samba4 (from .../samba4_4.0.0~alpha18.dfsg1-4ubuntu2_amd64.deb) ...
Processing triggers for ureadahead ...
Setting up samba4 (4.0.0~alpha18.dfsg1-4ubuntu2) ...
ERROR: Invalid smb.conf
ERROR: Invalid smb.conf
unable to open smb.conf at /usr/share/samba/setoption.pl line 22.
dpkg: error processing samba4 (--configure):
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
samba4
E: Sub-process /usr/bin/dpkg returned an error code (1)
In my case, I won’t be needing the missing modules. The workaround is to tell ubuntu the package installed correctly. Samba worked just fine for me without the missing .so file.
Edit /var/lib/dpkg/status and search for:
Package: samba4
Status: install ok half-configured
Replace with:
Package: samba4
Status: install ok installed