当我尝试在 Debian buster 上安装 samba 时,如下所示:
sudo apt install samba
我得到这个输出:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
attr libcephfs2 libgpgme11 python-crypto python-dnspython python-gpg python-ldb python-samba python-tdb samba-common-bin
samba-dsdb-modules samba-vfs-modules tdb-tools
Suggested packages:
python-crypto-doc bind9 bind9utils ctdb ldb-tools ntp | chrony smbldap-tools winbind heimdal-clients
The following NEW packages will be installed:
attr libcephfs2 libgpgme11 python-crypto python-dnspython python-gpg python-ldb python-samba python-tdb samba samba-common-bin
samba-dsdb-modules samba-vfs-modules tdb-tools
0 upgraded, 14 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,877 kB/5,457 kB of archives.
After this operation, 38.9 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf python-dnspython all 1.16.0-1 [90.1 kB]
Get:2 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf python-crypto armhf 2.6.1-9+b1 [248 kB]
Get:3 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf python-ldb armhf 2:1.5.1+really1.4.6-3 [33.1 kB]
Get:4 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf python-tdb armhf 1.3.16-2+b1 [16.0 kB]
Get:5 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf python-samba armhf 2:4.9.5+dfsg-5+deb10u1+rpi1 [1,794 kB]
Get:6 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf tdb-tools armhf 1.3.16-2+b1 [26.9 kB]
Get:7 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf attr armhf 1:2.4.48-4 [39.4 kB]
Get:8 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf libcephfs2 armhf 12.2.11+dfsg1-2.1+rpi1 [380 kB]
Get:9 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf libgpgme11 armhf 1.12.0-6 [230 kB]
Get:10 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf python-gpg armhf 1.12.0-6 [275 kB]
Get:11 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf samba-dsdb-modules armhf 2:4.9.5+dfsg-5+deb10u1+rpi1 [345 kB]
Get:12 http://mirrors.ocf.berkeley.edu/raspbian/raspbian buster/main armhf samba-vfs-modules armhf 2:4.9.5+dfsg-5+deb10u1+rpi1 [400 kB]
Fetched 3,877 kB in 6s (641 kB/s)
Selecting previously unselected package python-dnspython.
(Reading database ... 103379 files and directories currently installed.)
Preparing to unpack .../00-python-dnspython_1.16.0-1_all.deb ...
Unpacking python-dnspython (1.16.0-1) ...
Selecting previously unselected package python-crypto.
Preparing to unpack .../01-python-crypto_2.6.1-9+b1_armhf.deb ...
Unpacking python-crypto (2.6.1-9+b1) ...
Selecting previously unselected package python-ldb.
Preparing to unpack .../02-python-ldb_2%3a1.5.1+really1.4.6-3_armhf.deb ...
Unpacking python-ldb (2:1.5.1+really1.4.6-3) ...
Selecting previously unselected package python-tdb.
Preparing to unpack .../03-python-tdb_1.3.16-2+b1_armhf.deb ...
Unpacking python-tdb (1.3.16-2+b1) ...
Selecting previously unselected package python-samba.
Preparing to unpack .../04-python-samba_2%3a4.9.5+dfsg-5+deb10u1+rpi1_armhf.deb ...
Unpacking python-samba (2:4.9.5+dfsg-5+deb10u1+rpi1) ...
Selecting previously unselected package samba-common-bin.
Preparing to unpack .../05-samba-common-bin_2%3a4.9.5+dfsg-5+deb10u1+rpi1_armhf.deb ...
Unpacking samba-common-bin (2:4.9.5+dfsg-5+deb10u1+rpi1) ...
Selecting previously unselected package tdb-tools.
Preparing to unpack .../06-tdb-tools_1.3.16-2+b1_armhf.deb ...
Unpacking tdb-tools (1.3.16-2+b1) ...
Selecting previously unselected package samba.
Preparing to unpack .../07-samba_2%3a4.9.5+dfsg-5+deb10u1+rpi1_armhf.deb ...
Unpacking samba (2:4.9.5+dfsg-5+deb10u1+rpi1) ...
Selecting previously unselected package attr.
Preparing to unpack .../08-attr_1%3a2.4.48-4_armhf.deb ...
Unpacking attr (1:2.4.48-4) ...
Selecting previously unselected package libcephfs2:armhf.
Preparing to unpack .../09-libcephfs2_12.2.11+dfsg1-2.1+rpi1_armhf.deb ...
Unpacking libcephfs2:armhf (12.2.11+dfsg1-2.1+rpi1) ...
Selecting previously unselected package libgpgme11:armhf.
Preparing to unpack .../10-libgpgme11_1.12.0-6_armhf.deb ...
Unpacking libgpgme11:armhf (1.12.0-6) ...
Selecting previously unselected package python-gpg.
Preparing to unpack .../11-python-gpg_1.12.0-6_armhf.deb ...
Unpacking python-gpg (1.12.0-6) ...
Selecting previously unselected package samba-dsdb-modules:armhf.
Preparing to unpack .../12-samba-dsdb-modules_2%3a4.9.5+dfsg-5+deb10u1+rpi1_armhf.deb ...
Unpacking samba-dsdb-modules:armhf (2:4.9.5+dfsg-5+deb10u1+rpi1) ...
Selecting previously unselected package samba-vfs-modules:armhf.
Preparing to unpack .../13-samba-vfs-modules_2%3a4.9.5+dfsg-5+deb10u1+rpi1_armhf.deb ...
Unpacking samba-vfs-modules:armhf (2:4.9.5+dfsg-5+deb10u1+rpi1) ...
Setting up python-crypto (2.6.1-9+b1) ...
Setting up attr (1:2.4.48-4) ...
Setting up samba-vfs-modules:armhf (2:4.9.5+dfsg-5+deb10u1+rpi1) ...
Setting up libgpgme11:armhf (1.12.0-6) ...
Setting up libcephfs2:armhf (12.2.11+dfsg1-2.1+rpi1) ...
Setting up python-ldb (2:1.5.1+really1.4.6-3) ...
Setting up tdb-tools (1.3.16-2+b1) ...
update-alternatives: using /usr/bin/tdbbackup.tdbtools to provide /usr/bin/tdbbackup (tdbbackup) in auto mode
Setting up python-tdb (1.3.16-2+b1) ...
Setting up samba-dsdb-modules:armhf (2:4.9.5+dfsg-5+deb10u1+rpi1) ...
Setting up python-dnspython (1.16.0-1) ...
Setting up python-gpg (1.12.0-6) ...
Setting up python-samba (2:4.9.5+dfsg-5+deb10u1+rpi1) ...
Setting up samba-common-bin (2:4.9.5+dfsg-5+deb10u1+rpi1) ...
Checking smb.conf with testparm
Load smb config files from /etc/samba/smb.conf
Error loading services.
dpkg: error processing package samba-common-bin (--configure):
installed samba-common-bin package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of samba:
samba depends on samba-common-bin (= 2:4.9.5+dfsg-5+deb10u1+rpi1); however:
Package samba-common-bin is not configured yet.
dpkg: error processing package samba (--configure):
dependency problems - leaving unconfigured
Processing triggers for ufw (0.36-1) ...
Processing triggers for systemd (241-7~deb10u4+rpi1) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for libc-bin (2.28-10+rpi1) ...
Errors were encountered while processing:
samba-common-bin
samba
E: Sub-process /usr/bin/dpkg returned an error code (1)
m
由于安装似乎安装 samba-common-bin,我不明白依赖错误意味着什么。
答案1
事实证明,问题是由缺少配置文件引起的/etc/samba/smb.conf
。我不知道为什么安装程序在缺少配置文件时不简单地创建/复制它,但无论如何。
关于我如何解决这个问题的更深入的描述可以在https://imperfect.olbert.com/doing-a-little-samba/。