今天刚刚尝试这样做sudo apt-get dist-upgrade
;我来到了这种状态:
$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
phablet-tools ubuntu-sdk
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
好的,ubuntu-sdk
一直被保留/阻止,可能由于依赖关系而需要安装新的软件包;因此我尝试dist-upgrade
:
$ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
intltool
The following packages have been kept back:
ubuntu-sdk
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 52.0 kB of archives.
After this operation, 245 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://dk.archive.ubuntu.com/ubuntu/ trusty/main intltool all 0.50.2-2 [52.0 kB]
Fetched 52.0 kB in 0s (872 kB/s)
Selecting previously unselected package intltool.
(Reading database ... 343935 files and directories currently installed.)
Preparing to unpack .../intltool_0.50.2-2_all.deb ...
Unpacking intltool (0.50.2-2) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up intltool (0.50.2-2) ...
嗯...所以只是intltool
安装在那里,不是ubuntu-sdk
;让我们再试一次:
$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
phablet-tools ubuntu-sdk
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
嗯……dist-upgrade
又来了?
$ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
ubuntu-sdk
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
仍然保持后退...让我们尝试用力一点sudo apt-get install...
:
$ sudo apt-get install phablet-tools ubuntu-sdk
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:
ubuntu-sdk : Depends: ubuntu-device-flash but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
那我们尝试一下ubuntu-device-flash
:
$ sudo apt-get install ubuntu-device-flash
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:
ubuntu-device-flash : Depends: click-ubuntu-policy but it is not installable
Depends: ubuntu-snappy-cli but it is not installable
E: Unable to correct problems, you have held broken packages.
让我们尝试一下click-ubuntu-policy
,尽管现在我并不抱太大希望:
$ sudo apt-get install click-ubuntu-policy
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package click-ubuntu-policy is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'click-ubuntu-policy' has no installation candidate
太好了,显然click-ubuntu-policy
它不再在仓库中了,但是它在ubuntu-device-flash
包中仍然有一个悬而未决的依赖关系。
在这种情况下,建议我采取什么行动?
答案1
来自apt-get
手册页
dist-upgrade 除了执行升级功能外,还智能地处理软件包新版本依赖关系的变化;apt-get 有一个“智能”冲突解决系统,它会尝试升级最重要的软件包,并在必要时牺牲不太重要的软件包。因此,dist-upgrade 命令可能会删除一些软件包。/etc/apt/sources.list 文件包含可从中检索所需软件包文件的位置列表
dist-upgrade
尝试安装新软件包进行升级(与实际操作相反upgrade
),但只有当在文件中列出的任何位置找到该软件包时,它才能这样做/etc/apt/sources.list
。如果存储库缺少某个软件包,它如何找到它?如果找不到该软件包,它不会升级它,而是保留该软件包。
这就是你的情况。click-ubuntu-policy
软件包在可信赖的官方存储库中不可用(并且从未可用)(请访问 packages.ubuntu.com 查看)ubuntu-device-flash
将不会升级,因为它的较新版本依赖于click-ubuntu-policy
,而该版本在任何已知的存储库中均不可用apt
。
click-ubuntu-policy
但是,如果您添加了具有的PPA 或存储库源trusty
,则可以升级ubuntu-device-flash
软件包。 但不建议这样做。
我的建议是,由于 Ubuntu 包含了较新版本的ubuntu-device-flash
,我认为click-ubuntu-policy
它很快就会在存储库中可用。