2

When I try to update my system I get jdk-openjdk and jre-openjdk are in conflict error:

This is log of the update attempt:

:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
 multilib is up to date
:: Searching AUR for updates...
:: Searching databases for updates...
 -> Packages not in AUR: bunjs-bin  flite1-patched  jellyfin-server-bin  jellyfin-web-bin  js78  libgweather  libopenaptx  libvterm01  nodejs-lts-gallium  progsreiserfs  python-backcall
 -> Orphan (unmaintained) AUR Packages: anki-official-binary-bundle  jdk-jetbrains  jetbrains-clion-pj  python-gymnasium-notices  python-hijri-converter  python-jax-jumpy  python-pep517
 -> Flagged Out Of Date AUR Packages: anki-official-binary-bundle  blades-bin  logseq-desktop-wayland-bin  marp-cli  python-mypy-protobuf  steamcmd  vrms-arch
 -> gcc10: local (1:10.3.0-2) is newer than AUR (10.5.0-1)
 -> gcc10-libs: local (1:10.3.0-2) is newer than AUR (10.5.0-1)
:: 8 packages to upgrade/install.
8  extra/jdk-openjdk             21.u35-3     -> 21.u35-7
7  extra/jdk11-openjdk           11.0.21.u9-2 -> 11.0.21.u9-3
6  extra/jre-openjdk             21.u35-3     -> 21.u35-7
5  extra/jre-openjdk-headless    21.u35-3     -> 21.u35-7
4  extra/jre11-openjdk           11.0.21.u9-2 -> 11.0.21.u9-3
3  extra/jre11-openjdk-headless  11.0.21.u9-2 -> 11.0.21.u9-3
2  extra/jre17-openjdk           17.0.9.u8-1  -> 17.0.9.u8-2
1  extra/jre17-openjdk-headless  17.0.9.u8-1  -> 17.0.9.u8-2
==> Packages to exclude: (eg: "1 2 3", "1-3", "^4" or repo name)
 -> Excluding packages may cause partial upgrades and break systems
==>
Sync Dependency (4): jre11-openjdk-headless-11.0.21.u9-3, jre17-openjdk-headless-17.0.9.u8-2, jre-openjdk-headless-21.u35-7, jre11-openjdk-11.0.21.u9-3
Sync Explicit (4): jre17-openjdk-17.0.9.u8-2, jdk-openjdk-21.u35-7, jdk11-openjdk-11.0.21.u9-3, jre-openjdk-21.u35-7
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
 multilib is up to date
:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...
error: unresolvable package conflicts detected
error: failed to prepare transaction (conflicting dependencies)
:: jdk-openjdk and jre-openjdk are in conflict
 -> error installing repo packages

What is optimal way to resolve this conflict ?
Thank you for help


EDIT:
I tried sudo pacman -R jre-openjdk but I got this error:

checking dependencies...
error: failed to prepare transaction (could not satisfy dependencies)
:: removing jre-openjdk breaks dependency 'jre21-openjdk=21.u35-3' required by jdk-openjdk
1
  • Can you do without one of them? In that case, uninstall the one that you don't need.
    – Kusalananda
    Commented Nov 6, 2023 at 10:30

2 Answers 2

7

For this sort of thing, always check out Arch Linux News. In this case, we want Incoming changes in JDK / JRE 21 packages may require manual intervention:

Incoming changes in JDK / JRE 21 packages may require manual intervention

2023-11-02 - Frederik Schwan

We are introducing a change in JDK/JRE packages of our distro. This is triggered from the way a JRE is build in modern versions of Java (>9). We are introducing this change in Java 21.

To sum it up instead of having JDK and JRE packages coexist in the same system we will be making them conflict. The JDK variant package includes the runtime environment to execute Java applications so if one needs compilation and runtime of Java they need only the JDK package in the future. If, on the other hand, they need just runtime of Java then JRE (or jre-headless) will work.

This will (potentially) require a manual user action during upgrade:

If you have both JDK and JRE installed you can manually install the JDK with pacman -Syu jdk-openjdk and this removes the JRE related packages. If you have both JRE and JRE-headless you will need to choose one of them and install it manually since they would conflict each other now. If you only have one of the JDK/JRE/JRE-headless pacman should resolve dependencies normally and no action is needed. At the moment this is only valid for the upcoming JDK 21 release.

In my particular case, I fixed this yesterday with:

sudo pacman -R jre-openjdk
sudo pacman -Suy

But the specifics will depend on what you have installed and what you need as explained in the quoted article.

2
  • I tries your suggestion but I have ended up with error. I added the error into the question Commented Nov 6, 2023 at 13:30
  • 3
    @JanČerný my suggestion was to read the article and do what makes sense in your situation. Try sudo pacman -R jdk-openjdk jre-openjdk to remove both, and then sudo pacman -Suy.
    – terdon
    Commented Nov 6, 2023 at 16:07
3

First update jdk-openjdk, this will suggest to remove jre-openjdk as stated in Incoming changes in JDK / JRE 21 packages may require manual intervention.

manually install the JDK ... this removes the JRE related packages.

Then do the full upgrade afterwards.

sudo pacman -S jdk-openjdk
sudo pacman -Syu

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .