Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When doing apt-get install samba smbfs I get the following error. How do I go about troubleshooting and fixing this?

Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)
The entire output from apt-get is pasted below.
The following NEW packages will be installed
  samba smbfs
0 upgraded, 2 newly installed, 0 to remove and 34 not upgraded.
Need to get 1350kB/5645kB of archives.
After this operation, 16.1MB of additional disk space will be used.
Get: 1 lenny/main smbfs 2:3.2.5-4lenny6 [1350kB]
Fetched 1350kB in 2s (479kB/s)
Preconfiguring packages ...
Selecting previously deselected package samba.
(Reading database ... 108352 files and directories currently installed.)
Unpacking samba (from .../samba_2%3a3.2.5-4lenny6_i386.deb) ...
Selecting previously deselected package smbfs.
Unpacking smbfs (from .../smbfs_2%3a3.2.5-4lenny6_i386.deb) ...
Processing triggers for man-db ...
Setting up samba (2:3.2.5-4lenny6) ...
Generating /etc/default/samba...
Starting Samba daemons: nmbd failed!
invoke-rc.d: initscript samba, action "start" failed.
dpkg: error processing samba (--configure):
 subprocess post-installation script returned error exit status 1
Setting up smbfs (2:3.2.5-4lenny6) ...
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)
share|improve this question
up vote 1 down vote accepted

The error is occuring while starting nmbd. Samba is installed, but for some reason can't start. You can run nmbd manually, as root, with the command:

/usr/sbin/nmbd -S -d 1

which will produce debugging output on the screen. That will help understand why it's failing; if it doesn't help you post the output here.

share|improve this answer
I started smbd with that debugging output and found that the config file wasn't getting placed in the /etc/samba directory. Copying the /share/samba/smb.conf appears to have fixed the problem. – Jared Sep 13 '09 at 15:56

This worked for me

apt-get purge samba-common
apt-get install samba
share|improve this answer

well... looking at samba / nmbd logs. they can be helpful [ /var/log/samba/ ]

is it possible that samba was installed earlier on this system.. and messed up configuration files ware left?

share|improve this answer
There was a former install, it somehow messed up the install process so a default config file wasn't being placed in /etc/samba/smb.conf Moving the sample one from /usr/share/samba/smb.conf to /etc/samba/smb.conf allowed it to start. – Jared Sep 13 '09 at 15:58

I got the same problem the last minutes - and found my own problem. Thus, I'd like to present "my" solution: From my old installation there has been the /etc/init.d/samba which got not removed by apt-get remove --purge. Deleting it and reinstalling samba worked fine.



share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.