Samba 在 ubuntu 12.10 上安装失败

Samba 在 ubuntu 12.10 上安装失败

我试图安装 Samba 来访问通过办公网络连接的 Windows PC 上的共享打印机,终端出现以下响应。请指导我如何安装 Samba 或任何其他替代方案。


crm@crm-HP-G62-Notebook-PC:~$ sudo apt-get install samba
[sudo] password for crm: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 samba : Depends: samba-common (= 2:3.6.6-3ubuntu4) but 2:3.6.6-3ubuntu5 is to be installed
         Depends: libwbclient0 (= 2:3.6.6-3ubuntu4) but 2:3.6.6-3ubuntu5 is to be installed
         Recommends: tdb-tools but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
crm@crm-HP-G62-Notebook-PC:~$

答案1

跑步:

sudo apt-get install --fix-broken && sudo apt-get autoremove && sudo apt-get update && sudo apt-get install samba

如果不成功,然后删除那些未满足依赖关系的特定软件包:

sudo apt-get remove samba-common libwbclient0 tdb-tools

如果不成功,那么你就必须做一些手动操作。

samba-common (= 2:3.6.6-3ubuntu4)在官方 Ubuntu 上不存在存储库对于 Ubuntu 12.10,你可以使用包含samba-common (= 2:3.6.6-3ubuntu4)

因此,您必须通过以下方式找到该存储库

apt-cache policy samba-common

在结果中,首先提到的 PPA 是造成问题的因素。

您需要确定它是 Worth 存储库还是 Useless。这意味着它是否安装了您已安装的重要包。为此,请运行:

aptitude search "?origin <ppa name> ?installed"

** 替换<ppa name>为 PPA 的名称(省略ppa:

这将列出从该 PPA 安装的软件包。

然后,如果它是一个包含其他重要包的有价值的存储库,你必须这样做 钉住

对于该次运行:

gksudo gedit /etc/apt/preferences

将以下行添加到文件并保存。

Package: samba-common
Pin: release o=Ubuntu
Pin-Priority: 200 

Package: samba-common
Pin: release o=LP-PPA-<ppa name>
Pin-Priority: 100

** 替换<ppa name>为 PPA 的名称(省略ppa:

然后,尝试再次安装。

如果是无用的 PPA,请删除 PPA 然后更新。

sudo add-apt-repository --remove <PPA Name> && sudo apt-get update

然后尝试安装。

答案2

拥有 /etc/samba/smb.conf 的软件包是

samba-common

如果 /etc/samba/smb.conf 缺失,你应该能够从 /usr/share/samba/smb.conf 复制配置,然后运行

sudo dpkg --configure samba-common

相关内容