ubuntu安装samba提示如下错误:

root@ubuntu# apt-get install samba 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: update-inetd but it is not going to be installed E: Unable to correct problems, you have held broken packages.

解决办法:

  1. 安装aptitude工具:

root@ubuntu # sudo apt-get install aptitude

提示已经安装最新版本。

  1. 使用 aptitude安装samba

root@ubuntu# sudo aptitude install samba

输入Y ,同意接受,但没有包更新。安装应未成功。

  1. 检查 并更新 source.list文件 检查系统版本: root@ubuntu:~# lsb_release -rc

修改source.list文件 root@ubuntu# vi /etc/apt/sources.list

  1. 更新source root@ubuntu:~# sudo apt-get update

  2. 再次安装samba root@ubuntu:~o# apt-get install samba

  3. 检查安装成功。

备注:

  1. aptitude 与 apt-get 一样,是 功能极其强大的包管理工具。与 apt-get 不同的是,aptitude 在处理依赖问题上更佳一些。举例来说,aptitude 在删除一个包时,会同时删除本身所依赖的包。这样,系统中不会残留无用的包,整个系统更为干净。

  2. 当还是安装不成功时,需检查源安装库是否配置正确(更新源安装库时需要注意系统的版本)。