I have set up a local repo for rocky 9 and there are multiple versions of java in the appstream/Pakages/j directory but it will only show java 11 if you want to install java.
I ran this: dnf install javapackages-tools
I tried: dnf module enable javapackages-tools but it returns the following:
Last metadata expiration check: 0:24:01 ago on Fri 02 Feb 2024 04:08:58 PM UTC.
Error: Problems in request:
missing groups or modules: javapackages-tools
It does not show in “dnf modules list”
I have searched on the error in quotes on google and the results said to install the rpm that I already installed and to run the command I posted. I also us AI to create a script to install and enable the module but it only returned the same commands I already attempted.
What else should I be attempting to do to either install/enable the module or troubleshoot it further?
Can you show an example of this?
javapackages-tools (the module) is not exposed in our repos. It is strictly a build requirement for maven. Is there something you need from the javapackages-tools module that you can’t get otherwise in the repos?
I want to be able to install java 21 which is in the repo but any dnf calls to the repo say it doesn’t exist.
dnf install java will offer java 11
dnf install java-21-openjdk returns:
No match for argument: java-21-openjdk
Error: Unable to find a match: java-21-openjdk
I am unsure how you synced the repos. Asking dnf to install java-21-openjdk works as intended for me.
[label@xmpp01 ~]$ sudo dnf install java-21-openjdk --assumeno
Last metadata expiration check: 2:35:41 ago on Fri 02 Feb 2024 09:21:39 AM MST.
================================================================================ Package Arch Version Repo Size
java-21-openjdk x86_64 1:220.127.116.11.13-1.el9 appstream 446 k
. . .
Ensure that you’re only using
dnf reposync and not running createrepo after for your local repos. Javapackage-tools is also not required to install java 21.
I did clean up some old directories and re-created the repo and then used the explicit java-21-openjdk and was able to download it.
Is there a way to get it so
dnf provides java
We are new to rocky so I think people want to be able to type “dnf provides java” and see all possible versions but what I read makes it sound like the module only shows the default.
Is there a way to see all the options in the repo using a dnf command?
Modules do not have any effect over java or related packages. java-11-openjdk by default provides “java”, so running
dnf provides java will only show you that version. “Provides” is from the package itself. If you are wanting java-21-openjdk, you would need to specify this when running dnf install.
If you want to see a list,
dnf search java* or
dnf search java | grep jdk