在 Debian 上安装 Samba 时出错

在 Debian 上安装 Samba 时出错

执行 apt-get install samba smbfs 时出现以下错误。我该如何排除故障并修复此问题?

Errors were encountered while processing:
 samba
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 http://ftp.uk.debian.org 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:
 samba
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

启动 nmbd 时发生错误。Samba 已安装,但由于某种原因无法启动。您可以以 root 身份使用以下命令手动运行 nmbd:

/usr/sbin/nmbd -S -d 1

这将在屏幕上产生调试输出。这将有助于了解失败的原因;如果它没有帮助,请在此处发布输出。

答案2

这对我有用

apt-get purge samba-common
apt-get install samba

答案3

嗯...查看 samba / nmbd 日志。它们可能会有帮助 [ /var/log/samba/ ]

是否有可能此前已在此系统上安装了 Samba...并且留下了混乱的配置文件?

答案4

几分钟前我遇到了同样的问题 - 并发现了自己的问题。因此,我想介绍“我的”解决方案:在我的旧安装中,有一个/etc/init.d/samba未被删除的apt-get remove --purge。删除它并重新安装 samba 效果很好。

问候

巴斯蒂

相关内容