[SOLVED] Error running apt-get upgrade on openhabian

  • Platform information:
    • Hardware: RPi3
    • OS: Raspbian stretch
    • Java Runtime Environment: OpenJRE 8
    • openHAB version: Openhabian 2.4.0-1 (Release)
  • Issue of the topic: please be detailed explaining your issue

I’m trying to do apt-get upgrade, and getting an error while upgrading openjdk-8-jre-headless:

Preparing to unpack .../openjdk-8-jre-headless_8u212-b03-2~deb9u1_armhf.deb ...
Unpacking openjdk-8-jre-headless:armhf (8u212-b03-2~deb9u1) over (8u181-b13-2~deb9u1) ...
dpkg: error processing archive /var/cache/apt/archives/openjdk-8-jre-headless_8u212-b03-2~deb9u1_armhf.deb (--unpack):
 unable to open '/usr/lib/jvm/java-8-openjdk-armhf/jre/lib/security/policy/unlimited/US_export_policy.jar.dpkg-new': No such file or directory
Errors were encountered while processing:
 /var/cache/apt/archives/openjdk-8-jre-headless_8u212-b03-2~deb9u1_armhf.deb

The deb file does not seem to contain the wanted policy jar files, or … something.

Deb files and apt-get are some of my least favorite parts of any Debian based system (grr) and I’m at a loss at what to do now.

These files dimly remind me of something I had to do for security, but I don’t know why the deb wouldn’t install.

Any guidance would be greatly appreciated!

Check if this works:

Sure you can try debugging that but either way openjdk is deprecated as Java for openHAB, so the better way is to install Zulu instead and remove the openjdk packages.

3 Likes

I thought one of the big advantages to using openhabian was that the maintainers would be taking care of managing which packages are installed and which packages are needed? If I don’t need this package, why is openhabian including it?

And if this change leaves me broken, how would I fix it?

When was the change to this other JDK made? I’m still running 2.4 - will it work with that?

That’s certainly related, and it’s creating files in the directories in question. It doesn’t fix the problem I’m having, because the deb file is trying to extract a file that isn’t present on the system there.

A minor dose of insomnia has me fiddling some more with this. The .deb file I’m trying to install contains these files:

-rw-r--r-- root/root       612 2019-05-28 12:55 ./usr/lib/jvm/java-8-openjdk-armhf/jre/lib/security/policy/limited/US_export_policy.jar
-rw-r--r-- root/root       612 2019-05-28 12:55 ./usr/lib/jvm/java-8-openjdk-armhf/jre/lib/security/policy/unlimited/US_export_policy.jar

The error message says it’s trying to unpack another file, though:

 unable to open '/usr/lib/jvm/java-8-openjdk-armhf/jre/lib/security/policy/unlimited/US_export_policy.jar.dpkg-new': No such file or directory

After turning the error reporting WAY up, I can see it tries to extract every file to the dpkg-new and then rename it. Something is preventing that for this file, and I don’t know what. Extracting the deb manually produces good files, so I don’t know what’s going wrong - and it isn’t saying.

Still struggling with apt-get and dpkg. My longstanding dislike of Debian is not getting any better.

Because you or others may want to use it. It once was the default so many might still use it so we cant throw it out right away.

I answered that already. If you still insist on fixing it I suggest you go ask in a Debian forum.

I don’t remember but it is several months. Of course Zulu works with 2.4.

I meant “if removing OpenJDK and moving to Zulu leaves me broken, how would I fix it?”, not fixing OpenJDK. I’m happy to remove OpenJDK if it’s not being used, especially considering the install is being weird.

Looking at the various Java links, I see that the Zulu one is the default, and that it’s the only one being used right now. I had no idea a change of JRE had been made.

As it isn’t in use, I agree and now understand better that removing OpenJDK should be safe enough. I’ll… run a backup… and give it a try.

And, I have gotten enough things removed that apt works again. Thank you for the information that this was no longer needed.

As of August 7th, 2016 the docs have recommended against using OpenJDK.

A famous alternative to Oracle Java is the OpenJDK. Note that openHAB may be unstable and slower executed by OpenJDK, it is therefor recommended to switch to Oracle Java if possible.

The current docs state:

OpenJDK may also be used, but it has some known limitations with openHAB and is not recommended.

I have a vague recollection that this warning was also in place on the old openHAB 1.x wiki.

@mstormi, given that this warning has been in place for at least three years, maybe it’s worth removing it from openHABian now? I’m a little surprised that openHABian bothers to install it by default.

If you follow the “fresh install” menu, as recommended, it installs Zulu. I just reinstalled yesterday.

You’ll see the openHABian configuration menu and can now select all desired actions. The “Manual/Fresh Setup” submenu entry is the right place for you. Execute all entries one after the other to get the full openHABian experience:

From openHABian | openHAB

It does not, the default is to install Zulu.
Eventually the Pi image (which is pretty old) still includes that although openhabian-setup should update itself on every start, but that may fail or the user skips it.

1 Like