3种不同的OpenJDK在RHEL7上使用YUM。

huangapple go评论122阅读模式
英文:

3 different Openjkds on RHEL7 with YUM

问题

我需要在EL7上安装3个不同版本的openjdk(11.0.5、11.0.6、11.0.7)。

我看到RHEL7仓库中有这3个版本都可用,但有一个要求是将0.5/0.6的所有软件包文件安装在用户自定义位置,而0.7应安装在默认位置。

我需要使用YUM来避免在YUM之外更改RPM数据库,并确保YUM更新不会升级0.5/0.6。

自从0.6以后,Tar.gz已不再可用,所以我想使用来自RHEL仓库的OpenJDK。

我应该使用“update-alternatives —list”、“yum --installroot= install ”还是其他方法?我曾建议使用虚拟环境,但被拒绝了。

谢谢您的建议!

英文:

I need to install 3 different versions of openjdk (11.0.5, 11.0.6, 11.0.7) on EL7.

I see all 3 versions available in RHEL7 repo but there is an ask to install all package files for 0.5/0.6 in user custom location while 0.7 should be installed in default location.

I need to use YUM to avoid altering the RPM DB outside of YUM and I need to make sure that YUM update will not upgrade 0.5/0.6.

Tar.gz is no longer available since 0.6 so I want to use OpenJDK from RHEL repo.

Shall I use "update-alternatives —list”, "yum --installroot=<path> install <package1>” or some other way? I was suggesting to use virtual_env but that was rejected.

Thanks for your thoughts!

答案1

得分: 1

我不认为这是可能的。如果你只想使用这些包来获取代码,你可以手动从旧的包中提取文件:

rpm2cpio ./openjdk-11.0.5.rpm | cpio -idmv

然后你可以安装这些文件到任何你想要的地方。请注意,这些文件将不会被rpm跟踪,因此也不会被rpm更新或删除。

英文:

I don't think that is possible. If you just want to use the packages to get your hands on the code, you can extract the files from the older packages manually:

rpm2cpio ./openjdk-11.0.5.rpm | cpio -idmv

You can then install those wherever you want. Note that the files will thus not be tracked by rpm, and will thus not be updated/removed by rpm.

huangapple
  • 本文由 发表于 2020年8月6日 19:02:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/63282196.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定