在ubuntu 12.10上安装Samba失败

我试图安装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:~$ 

跑:

 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 

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

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

所以你必须找到那个存储库

 apt-cache policy samba-common 

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

你需要找到天气它是一个Worth存储库或无用。 这意味着天气已经安装了您安装的重要包。 为此,运行:

 aptitude search "?origin  ?installed" 

**用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- Pin-Priority: 100 

**将替换为PPA的名称(省略ppa:

然后,尝试再次安装。

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

 sudo add-apt-repository --remove  && sudo apt-get update 

然后尝试安装。

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

 samba-common 

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

 sudo dpkg --configure samba-common