我家里有一台 Debian 6.0,由 Lenny 升级。我需要安装该tzdata-java
软件包,但当我安装时,apt-get install
我收到以下消息:
以下软件包具有未满足的依赖关系:
tzdata-java:依赖:tzdata(= 2011c-0squeeze1)但需要安装 2011d-0lenny1
E: 包装破损
我在网上搜索过,但我不明白这个错误意味着什么。
答案1
我在 squeeze 上也遇到过同样的问题,但这个答案也适用于旧版本。只需根据tzdata
需要更改 的版本号即可。
首先,执行以下操作apt-cache showpkg tzdata
:
raphael@hydra:~$ apt-cache showpkg tzdata-java
Package: tzdata-java
Versions:
(snip)
Dependencies:
2011k-0squeeze1 - tzdata (5 2011k-0squeeze1)
Provides:
2011k-0squeeze1 -
Reverse Provides:
如您所见,这取决于tzdata (2011k-0squeeze1)
- 至少取决于我的系统。现在让我们看一下tzdata
:
raphael@hydra:~$ apt-cache showpkg tzdata
Package: tzdata
Versions:
(snip)
Provides:
2011l-0squeeze1 - tzdata-squeeze
2011k-0squeeze1 - tzdata-squeeze
Reverse Provides:
哦,看,我已经安装了2011k
新旧版本2011l
。我不知道为什么它不起作用,但是,我们可以强制 apt-get 降级tzdata
,正如我们将看到的,这将在时空中造成撕裂:
raphael@hydra:~$ sudo apt-get install tzdata=2011k-0squeeze1
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be DOWNGRADED:
tzdata
0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.
Need to get 630 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
(snip)
dpkg: warning: downgrading tzdata from 2011l-0squeeze1 to 2011k-0squeeze1.
(Reading database ... 167509 files and directories currently installed.)
Preparing to replace tzdata 2011l-0squeeze1 (using .../tzdata_2011k-0squeeze1_all.deb) ...
Unpacking replacement tzdata ...
Setting up tzdata (2011k-0squeeze1) ...
(snip)
现在你可能会想,嘿,如果我运行更新管理器,它会安装较新的 tzdata!但不,它不会:
raphael@hydra:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
(薛定谔的包裹反击了。)
瞧,现在我可以安装tzdata-java
:
raphael@hydra:~$ sudo apt-get install tzdata-java
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
tzdata-java
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 143 kB of archives.
(snip)