【工具使用】Linux日常使用之软件安装失败的处理方式
2018-02-02 09:44
706 查看
从古董系统Ubuntu12.04一路升级到较新的16.04,发现有些软件,如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: python-samba but it is not going to be installed
Depends: samba-common (= 2:4.3.8+dfsg-0ubuntu1) but 2:4.3.11+dfsg-0ubuntu0.14.04.11 is to be installed
Depends: samba-common-bin (= 2:4.3.8+dfsg-0ubuntu1) but it is not going to be installed
Depends: libwbclient0 (= 2:4.3.8+dfsg-0ubuntu1) but 2:4.3.11+dfsg-0ubuntu0.14.04.11 is to be installed
Depends: samba-libs (= 2:4.3.8+dfsg-0ubuntu1) but it is not going to be installed
Recommends: attr
Recommends: samba-dsdb-modules but it is not going to be installed
Recommends: samba-vfs-modules but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
提示是
过程如下:
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:
python-samba : Depends: samba-libs (= 2:4.3.8+dfsg-0ubuntu1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
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-libs : Depends: libwbclient0 (= 2:4.3.8+dfsg-0ubuntu1) but 2:4.3.11+dfsg-0ubuntu0.14.04.11 is to be installed
E: Unable to correct problems, you have held broken packages.
Reading package lists… Done
Building dependency tree
Reading state information… Done
libwbclient0 is already the newest version (2:4.3.11+dfsg-0ubuntu0.14.04.11).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages will be REMOVED:
libwbclient0
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 209 kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database … 318410 files and directories currently installed.)
Removing libwbclient0:amd64 (2:4.3.11+dfsg-0ubuntu0.14.04.11) …
Processing triggers for libc-bin (2.23-0ubuntu3) …
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following NEW packages will be installed:
libwbclient0
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 30.4 kB of archives.
After this operation, 186 kB of additional disk space will be used.
Get:1 http://mirrors.aliyun.com/ubuntu xenial/main amd64 libwbclient0 amd64 2:4.3.8+dfsg-0ubuntu1 [30.4 kB]
Fetched 30.4 kB in 0s (146 kB/s)
Selecting previously unselected package libwbclient0:amd64.
(Reading database … 318404 files and directories currently installed.)
Preparing to unpack …/libwbclient0_2%3a4.3.8+dfsg-0ubuntu1_amd64.deb …
Unpacking libwbclient0:amd64 (2:4.3.8+dfsg-0ubuntu1) …
Processing triggers for libc-bin (2.23-0ubuntu3) …
Setting up libwbclient0:amd64 (2:4.3.8+dfsg-0ubuntu1) …
Processing triggers for libc-bin (2.23-0ubuntu3) …
Reading package lists… Done
Building dependency tree
Reading state information… Done
libwbclient0 is already the newest version (2:4.3.8+dfsg-0ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
其它的依赖包按照此方法去一一操作,操作完成了之后便可以安装好之前想安装的软件了。
apt -f install也没办法处理。一直放着,今天还是觉得samba有一些方便,便花了一点时间去看这个问题。
错误详情
➜ ~ sudo apt 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: python-samba but it is not going to be installed
Depends: samba-common (= 2:4.3.8+dfsg-0ubuntu1) but 2:4.3.11+dfsg-0ubuntu0.14.04.11 is to be installed
Depends: samba-common-bin (= 2:4.3.8+dfsg-0ubuntu1) but it is not going to be installed
Depends: libwbclient0 (= 2:4.3.8+dfsg-0ubuntu1) but 2:4.3.11+dfsg-0ubuntu0.14.04.11 is to be installed
Depends: samba-libs (= 2:4.3.8+dfsg-0ubuntu1) but it is not going to be installed
Recommends: attr
Recommends: samba-dsdb-modules but it is not going to be installed
Recommends: samba-vfs-modules but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
原因
我觉得大致如下:提示是
packages have unmet dependencies,再仔细看一下下面的描述,这种问题其实就是软件所依赖的包的版本不对,基本一可以通过
sudo apt -f install解决,但是该包被以为是最新的,无法被替换掉。
解决办法
先把这些依赖包全部卸载掉,然后再安装回来。过程如下:
➜ ~ sudo apt install python-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:
python-samba : Depends: samba-libs (= 2:4.3.8+dfsg-0ubuntu1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
➜ ~ sudo apt install samba-libs
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-libs : Depends: libwbclient0 (= 2:4.3.8+dfsg-0ubuntu1) but 2:4.3.11+dfsg-0ubuntu0.14.04.11 is to be installed
E: Unable to correct problems, you have held broken packages.
➜ ~ sudo apt install libwbclient0
Reading package lists… Done
Building dependency tree
Reading state information… Done
libwbclient0 is already the newest version (2:4.3.11+dfsg-0ubuntu0.14.04.11).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
➜ ~ sudo apt remove libwbclient0:amd64
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages will be REMOVED:
libwbclient0
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 209 kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database … 318410 files and directories currently installed.)
Removing libwbclient0:amd64 (2:4.3.11+dfsg-0ubuntu0.14.04.11) …
Processing triggers for libc-bin (2.23-0ubuntu3) …
➜ ~ sudo apt install libwbclient0
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following NEW packages will be installed:
libwbclient0
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 30.4 kB of archives.
After this operation, 186 kB of additional disk space will be used.
Get:1 http://mirrors.aliyun.com/ubuntu xenial/main amd64 libwbclient0 amd64 2:4.3.8+dfsg-0ubuntu1 [30.4 kB]
Fetched 30.4 kB in 0s (146 kB/s)
Selecting previously unselected package libwbclient0:amd64.
(Reading database … 318404 files and directories currently installed.)
Preparing to unpack …/libwbclient0_2%3a4.3.8+dfsg-0ubuntu1_amd64.deb …
Unpacking libwbclient0:amd64 (2:4.3.8+dfsg-0ubuntu1) …
Processing triggers for libc-bin (2.23-0ubuntu3) …
Setting up libwbclient0:amd64 (2:4.3.8+dfsg-0ubuntu1) …
Processing triggers for libc-bin (2.23-0ubuntu3) …
➜ ~ sudo apt install libwbclient0
Reading package lists… Done
Building dependency tree
Reading state information… Done
libwbclient0 is already the newest version (2:4.3.8+dfsg-0ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
其它的依赖包按照此方法去一一操作,操作完成了之后便可以安装好之前想安装的软件了。
相关文章推荐
- 关于vmware软件菜单栏点击【虚拟机】->【安装VMware Tools】没反应安装失败的问题及Linux命令使用问题
- 在Linux系统中安装使用恶意软件扫描工具及杀毒引擎的教程
- 如何在 Linux 上安装和使用恶意软件检测工具 LMD 及杀毒引擎 ClamAV
- 在 Linux 上安装和使用恶意软件检测工具 LMD
- 如何在 Linux 上安装和使用恶意软件检测工具 LMD 及杀毒引擎 ClamAV
- Linux 软件安装使用(6)源码查看工具
- Linux(CentOS6.x)下使用yum软件管理工具安装LNMP(Nginx+PHP+Mysql)环境并配置虚拟主机vhost
- linux中json处理工具jq的安装和使用
- 如何在 Linux 上安装和使用恶意软件检测工具 LMD 及杀毒引擎 ClamAV
- Linux日常软件安装(FC6)
- Linux下源代码阅读工具lxr安装使用说明
- linux&unix软件的安装方式 汇集
- Linux终端下的BT软件CTorrent安装使用心得
- Linux下安装和使用杀毒软件AntiVir
- Linux 下的三大软件安装方式
- Linux使用yum进行软件安装和更新
- Linux下源代码阅读工具lxr安装使用说明
- Linux下源代码阅读工具lxr安装使用说明
- rar for linux的安装和使用(linux上首次软件安装成功)