0

I'm a bit stuck with package dependency. I'm not really sure how I got in to this mess but the current state: If I want to do any install using apt-get install or apt-get upgrade it gets stuck on a dependency loop with tzdata & tzdata-java.

So I did apt-get autoremove for some clean-up:

@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.

So I did apt-get autoremove -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)

Then I tried 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

Can I manually install this missing 2016g version together with 2016j to break this dependency circle ? If yes, how do I proceed ? Please advise...

As requested:

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

And sudo apt-cache policy 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

Also 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

.

  • I think it's suggesting you should run sudo apt-get -f install not sudo apt-get autoremove -f . Regardless, I'd suggest running sudo apt-get update first – steeldriver Mar 6 '17 at 2:04
  • Did apt-get update first. Then apt-get -f install . Exactly same output as the autoremove -f command above. – Jan Wiersma Mar 6 '17 at 2:08
  • Please edit your question to add the output of apt-cache policy tzdata and apt-cache policy tzdata-java. – fkraiem Mar 6 '17 at 4:29
  • Well, looks like version 2016j-0ubuntu0.12.04 of tzdata-java is available, so let's try to install it: sudo apt-get install tzdata-java=2016j-0ubuntu0.12.04. – fkraiem Mar 6 '17 at 5:42
  • Executed sudo apt-get install tzdata-java=2016j-0ubuntu0.12.04 , output - 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. – Jan Wiersma Mar 6 '17 at 5:56
0

What's Happening: You have a version conflict.

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.

Let's look at which version of tzdata is in the Ubuntu repos:

$ 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

So far, so good You are clearly running 12.04, and tzdata is clearly the latest available version.

Now let's see if your version of tzdata-java matches 12.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

Uh-oh. The latest tzdata-java is 2016j, not 2016g.

The Problem: Your tzdata-java is either from some non-ubuntu source, or (more likely) it's required by some other non-Ubuntu software on your system.

One Solution: Uninstall tzdata-java and all software that requires it. That software is no longer compatible with your release of Ubuntu. If you wish, you can ping the upstream source of that software - perhaps they have a compatible version available.

sudo apt-get remove tzdata-java

Be sure to read the list of removed packages carefully. Refuse the removal and return here if you have questions about what will be removed.

  • Instead of making assumptions about the state of installed packages on the system, ask for the necessary clarifications in comments. – fkraiem Mar 6 '17 at 4:26
  • Added the detailed output on dependency and source to the question. The uninstall obviously trips on openjdk-6-jre-headless . I'm checking what the impact of uninstall will be on the app running on this webserver. – Jan Wiersma Mar 6 '17 at 4:42
  • @fkraiem assumptions removed. Thanks for your input. – user535733 Mar 6 '17 at 5:11
0

Seemed to have fixed it using:

Downloading the tzdata 2016g version it was complaining about:

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

Installing it:

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

Then trigger a update

sudo apt-get update

Do a clean-up (output told me tzdata & tzdata-java are now all fine on 2016g version):

sudo apt-get autoremove

Then doing a full upgrade:

sudo apt-get upgrade

This last step got everything back up to the 2016j version

@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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.