12.04 版中未满足 tzdata 和 tzdata-java 的依赖关系

12.04 版中未满足 tzdata 和 tzdata-java 的依赖关系

我有点被软件包依赖问题困扰。我不太清楚自己是怎么陷入这种困境的,但目前的情况是:如果我想使用安装或者apt-get 升级它陷入了 tzdata 和 tzdata-java 的依赖循环。

所以我做了apt-get 自动删除进行一些清理:

@webserver1:~$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
tzdata-java : Depends: tzdata (= 2016g-0ubuntu0.12.04) but 2016j-0ubuntu0.12.04 is installed
E: Unmet dependencies. Try using -f.

所以我做了apt-get 自动删除 -f

@webserver1:~$ sudo apt-get autoremove -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
 tzdata-java
The following packages will be upgraded:
   tzdata-java
1 upgraded, 0 newly installed, 0 to remove and 62 not upgraded.
1 not fully installed or removed.
Need to get 126 kB of archives.
After this operation, 3,072 B of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://nl.archive.ubuntu.com/ubuntu/ precise-updates/main tzdata-java     all 2016j-0ubuntu0.12.04 [126 kB]
Fetched 126 kB in 0s (2,076 kB/s)
dpkg: dependency problems prevent configuration of tzdata-java:
tzdata-java depends on tzdata (= 2016g-0ubuntu0.12.04); however:
Version of tzdata on system is 2016j-0ubuntu0.12.04.
dpkg: error processing tzdata-java (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup  error from a previous failure.
Errors were encountered while processing:
  tzdata-java
E: Sub-process /usr/bin/dpkg returned an error code (1)

然后我尝试dpkg--configure-a

@webserver1:~$ dpkg --configure -a
dpkg: error: requested operation requires superuser privilege
logwise@webserver1:~$ sudo dpkg --configure -a
dpkg: dependency problems prevent configuration of tzdata-java:
tzdata-java depends on tzdata (= 2016g-0ubuntu0.12.04); however:
Version of tzdata on system is 2016j-0ubuntu0.12.04.
dpkg: error processing tzdata-java (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
tzdata-java

我可以手动安装这个缺失的 2016g 版本和 2016j 来打破这个依赖循环吗?如果可以,我该怎么做?请指教...

按照要求:

sudo apt-cache 策略 tzdata

tzdata:
Installed: 2016j-0ubuntu0.12.04
Candidate: 2016j-0ubuntu0.12.04
Version table:
*** 2016j-0ubuntu0.12.04 0
    500 nl.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
    500 security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
    100 /var/lib/dpkg/status
  2012b-1 0
    500 nl.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages

sudo apt-cache 策略 tzdata-java

tzdata-java:
Installed: 2016g-0ubuntu0.12.04
Candidate: 2016j-0ubuntu0.12.04
Version table:
 2016j-0ubuntu0.12.04 0
    500 nl.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
    500 security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
 *** 2016g-0ubuntu0.12.04 0
    100 /var/lib/dpkg/status
   2012b-1 0
    500 nl.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages

apt-cache showpkg tzdata-java

Reverse Depends:
openjdk-6-jre-headless,tzdata-java
openjdk-7-jre-headless,tzdata-java 2012e-0ubuntu0.12.04.1
openjdk-6-jre-headless,tzdata-java
openjdk-7-jre-headless,tzdata-java
openjdk-6-jre-headless,tzdata-java
Dependencies:
2016j-0ubuntu0.12.04 - tzdata (5 2016j-0ubuntu0.12.04)
2016g-0ubuntu0.12.04 - tzdata (5 2016g-0ubuntu0.12.04)
2012b-1 - tzdata (5 2012b-1)
Provides:
2016j-0ubuntu0.12.04 - tzdata-java:i386
2016g-0ubuntu0.12.04 - tzdata-java:i386
2012b-1 - tzdata-java:i386

答案1

发生了什么: 你有一个版本冲突

dpkg: dependency problems prevent configuration of tzdata-java:
tzdata-java depends on tzdata (= 2016g-0ubuntu0.12.04); however:
Version of tzdata on system is 2016j-0ubuntu0.12.04.

让我们看看 Ubuntu 存储库中的 tzdata 版本是哪个:

$ rmadison tzdata
 tzdata | 2012b-1              | precise          | source, all
 tzdata | 2016j-0ubuntu0.12.04 | precise-security | source, all
 tzdata | 2016j-0ubuntu0.12.04 | precise-updates  | source, all

到目前为止一切顺利,您显然正在运行 12.04,并且tzdata显然是最新可用版本。

现在让我们看看你的版本是否与tzdata-java12.04 匹配

$ rmadison tzdata-java
tzdata-java | 2012b-1              | precise          | all
tzdata-java | 2016j-0ubuntu0.12.04 | precise-security | all
tzdata-java | 2016j-0ubuntu0.12.04 | precise-updates  | all

哎呀。最新的tzdata-java是 2016j,而不是 2016g。

问题:您的tzdata-java源要么是来自某些非 Ubuntu 源,要么(更可能)是您的系统上某些其他非 Ubuntu 软件所需要的。

一个解决方案:卸载tzdata-java所有需要它的软件。该软件不再兼容与您的 Ubuntu 版本兼容。如果您愿意,您可以 ping 该软件的上游源代码 - 也许他们有兼容的版本可用。

sudo apt-get remove tzdata-java

请务必仔细阅读已删除软件包列表。如果您对将要删除的内容有任何疑问,请拒绝删除并返回此处。

答案2

似乎已经修复了它,使用:

下载它抱怨的tzdata 2016g版本:

wget "https://launchpad.net/ubuntu/+source/tzdata/2016g-0ubuntu0.12.04/+build/10969235/+files/tzdata_2016g-0ubuntu0.12.04_all.deb"

安装:

sudo dpkg -i tzdata_2016g-0ubuntu0.12.04_all.deb

然后触发更新

sudo apt-get update

进行清理(输出告诉我 tzdata 和 tzdata-java 在 2016g 版本上现在一切正常):

sudo apt-get autoremove

然后进行全面升级:

sudo apt-get upgrade

最后一步将所有内容恢复到 2016j 版本

@webserver1:~$ sudo apt-cache policy tzdata
tzdata:
Installed: 2016j-0ubuntu0.12.04
Candidate: 2016j-0ubuntu0.12.04
Version table:
*** 2016j-0ubuntu0.12.04 0
    500 nl.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
    500 security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
    100 /var/lib/dpkg/status
 2012b-1 0
    500 nl.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages

 @webserver1:~$ sudo apt-cache policy tzdata-java
 tzdata-java:
 Installed: 2016j-0ubuntu0.12.04
 Candidate: 2016j-0ubuntu0.12.04
 Version table:
 *** 2016j-0ubuntu0.12.04 0
    500 nl.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
    500 security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
    100 /var/lib/dpkg/status
 2012b-1 0
    500 nl.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages

相关内容