Upgrade from v9.12.1 Java 21 error

Creating a bug report/issue

I have searched the existing open and closed issues

Required Information

  • DietPi version: v9.12.1
  • Distro version: bookworm
  • Linux version: 7.1.2
  • Arch: arm64
  • SBC model: Quartz64 (aarch64) (details: SOQuartz - PINE64 . CPU is a quad Cortex A55)
  • Power used: PoE
  • SD card used: None, it’s a 128GB EMMC module

I’m trying to upgrade from v9.12.1, and the upgrade fails with the following logs:

root@caroline:~# apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  openhab
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 125 MB of archives.
After this operation, 15.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable/main arm64 openhab all 5.2.0-1 [125 MB]
Fetched 125 MB in 10s (12.2 MB/s)                                                                                                                                                                                                                                                                     
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 24058 files and directories currently installed.)
Preparing to unpack .../openhab_5.2.0-1_all.deb ...
[openHAB] WARNING: We were unable to detect Java 21 on your system. This is needed before openHAB is unpacked.
[openHAB] Java 21 may not be available on 32-bit platforms.
dpkg: error processing archive /var/cache/apt/archives/openhab_5.2.0-1_all.deb (--unpack):
 new openhab package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/openhab_5.2.0-1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

The only hint i have there is a Java 21 warning about 32bit platform, but my device definitively is arm64, so i don’t get what is the problem.

Do someone have any idea about what the issue could be or how can i get more info ?

Hmm, you are in a chicken&egg situation:

  • Debian Bookworm does not provide Java 21 yet.
  • DietPi v9.16 switches to Adoptium Java builds, enabling Java 21 on all Debian versions.
  • But upgrading DietPi usually means upgrading all APT packages.

I guess the simplest solution is to set the package on hold first. Try this schedule:

sudo apt-mark hold openhab
sudo apt upgrade
sudo dietpi-update 1
dietpi-software reinstall 196 # this switches to Adoptium Java 21
sudo apt-mark unhold openhab
sudo apt upgrade

Thanks a lot ! That worked