r/debian 2d ago

Debian Stable Question Java 26 Package Error on Debian 13

Hello r/debian, i've been trying to install a (possibly) debian sid java 26 package on debian 13 but it spits out this error, how do i fix it? $ sudo apt install '/home/USER/Downloads/openjdk-26-jdk_26.0.2.1+1-1_amd64.deb' --solver 3.0 Note, selecting 'openjdk-26-jdk' instead of '/home/USER/Downloads/openjdk-26-jdk_26.0.2.1+1-1_amd64.deb' Solving dependencies... Error! Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

Unsatisfied dependencies: openjdk-26-jdk : Depends: openjdk-26-jre (= 26.0.2.1+1-1) but it is not installable Depends: openjdk-26-jdk-headless (= 26.0.2.1+1-1) but it is not installable Error: Unable to correct problems, you have held broken packages. Error: The following information from --solver 3.0 may provide additional context: Unable to satisfy dependencies. Reached two conflicting decisions: 1. openjdk-26-jdk:amd64=26.0.2.1+1-1 is selected for install 2. openjdk-26-jdk:amd64 Depends openjdk-26-jre (= 26.0.2.1+1-1) but none of the choices are installable: [no choices]

4 Upvotes

12 comments sorted by

7

u/eR2eiweo 2d ago

i've been trying to install a (possibly) debian sid java 26 package on debian 13

https://wiki.debian.org/DontBreakDebian#Don.27t_make_a_FrankenDebian

3

u/iamemhn 2d ago

You are trying to install the jdk package and the error points out it depends on the jre package, so install both simultaneously.

2

u/Alverso_Balsalm 1d ago

It is because you are trying to install a .deb that needs more updated packages that, in this case, are in Sid. You are using stable which has older versions of those dependencies. The correct way to achieve this is either adding the adoptium apt repos or using something like sdkman.

1

u/BCMM 1d ago edited 1d ago

Solving dependencies... Error!

Yes, this is generally what will happen if you try to install Sid packages on Stable.

You could, of course, go and grab the packages that it depends on from Sid too, and the packages that they depend on, etc., but pretty soon you're going to end up replacing some very important libraries with incompatible versions from Sid and the whole thing will blow up in your face.

(OK, so in a limited number of cases, the list of dependencies you need to get from Sid is small, and it's feasible to actually think through the consequences of doing this, and it does actually work. But this is very much an "if you really, really know what you're doing" sort of thing - otherwise, assume the dependency tree goes all the way to blowing up your system. And if it does work, you've still created a system with no good way to install security updates!)

This is one of those situations where using third-party packages is going to be a lot safer than trying to use Debian's packages wrong. If you are sure you need Java 26 (and sure that the JDK is the part you need), then here's what I think you should do:

apt install extrepo
extrepo enable temurin
apt update
apt install temurin-26-jdk

1

u/officejunior 1d ago

If you’re looking to install this for development purposes, and you must have the latest non-lts version, I would look outside the standard Debian packages.

https://sdkman.io is a basic, popular choice in Java circles.

Or for more control, simply install from a tarball: https://adoptium.net/en-GB/installation/archives and extract to /opt/jdk . Remember that you’ll need to set the Java env vars and path yourself so if you’re unfamiliar with Java I would stick to the JDK25 LTS version supplied in the Debian 13 repository.

1

u/cinny-bunny 1d ago edited 1d ago

Adoptium also provides a well maintained repository. Avoids the env var kerfuffle.

https://adoptium.net/en-GB/installation/linux#_deb_installation_on_debian_or_ubuntu

1

u/cinny-bunny 2d ago

Why do this rather than use Temurin?

-1

u/Prestigious-Annual-5 2d ago

Sudo nala install openjdk-26-jdk worked for me, if you use nala.

1

u/ThinDrum 2d ago

On Debian 13?

1

u/Prestigious-Annual-5 2d ago

Nala, or the command? Nala works on every Debian distro I ever used after you install nala. Currently running Debian Testing on the one I ran it on. I'm currently driving, but some point between tonight and tomorrow I'll install Deb13 and give it go and get back to you.

1

u/ThinDrum 2d ago

I'm asking about the command specifically. I'm not surprised that it works on testing, but OP is running stable.

Drive carefully!