一步 yum 安装 32 位 java 1.7 与 Linux
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21149524/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
One step yum install of java 1.7 in 32 bit with Linux
提问by user3192053
Previously I was installing java 1.7 in 32 bit format with the following
以前,我使用以下内容以 32 位格式安装 java 1.7
(notice the ftp insert)
(注意 ftp 插入)
yum install ftp://rpmfind.net/linux/centos/6.4/updates/i386/Packages/java-1.7.0-openjdk-1.7.0.9-2.3.7.1.el6_3.i686.rpm
but now the install no longer works
但现在安装不再有效
[root@mmclntx ~]# yum install ftp://rpmfind.net/linux/centos/6.4/updates/i386/Packages/java-1.7.0-openjdk-1.7.0.9-2.3.7.1.el6_3.i686.rpm
Loaded plugins: product-id, rhnplugin, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
This system is receiving updates from RHN Classic or RHN Satellite.
Setting up Install Process
Cannot open: ftp://rpmfind.net/linux/centos/6.4/updates/i386/Packages/java-1.7.0-openjdk-1.7.0.9-2.3.7.1.el6_3.i686.rpm. Skipping.
Error: Nothing to do
[root@mmclntx ~]#
Is there a one step hum install command I can replace this with ?
是否有一个一步 hum install 命令可以替换它?
采纳答案by MariuszS
This works for me:
这对我有用:
yum install ftp://rpmfind.net/linux/centos/6.5/os/i386/Packages/java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.i686.rpm
Result
结果
Setting up Install Process
java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.i686.rpm | 27 MB 00:02
Examining /var/tmp/yum-root-19c9mu/java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.i686.rpm: 1:java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.i686
Marking /var/tmp/yum-root-19c9mu/java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.i686.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package java-1.7.0-openjdk.i686 1:1.7.0.45-2.4.3.3.el6 will be installed
...
I'm missing something?
我错过了什么?
With JDK 1.7
使用 JDK 1.7
# yum install java-1.7.0-openjdk
OpenJDK is in default updates
repository
OpenJDK 位于默认updates
存储库中
Name : java-1.7.0-openjdk
Arch : x86_64
Epoch : 1
Version : 1.7.0.51
Release : 2.4.4.1.el6_5
Size : 26 M
Repo : updates
Summary : OpenJDK Runtime Environment
URL : http://openjdk.java.net/
License : ASL 1.1 and ASL 2.0 and GPL+ and GPLv2 and GPLv2 with exceptions and LGPL+ and LGPLv2 and MPLv1.0 and MPLv1.1 and Public Domain and W3C
Description : The OpenJDK runtime environment.
回答by Stefano Sanfilippo
The installer does not work for a reason that is very clearly stated in the README in directory index:
安装程序不起作用的原因在目录索引的自述文件中非常清楚地说明:
This directory (and version of CentOS) is depreciated. For normal users, you should use /6/ and not /6.4/ in your path. Please see this FAQ concerning the CentOS release scheme:
http://www.centos.org/modules/smartfaq/faq.php?faqid=34
If you know what you are doing, and absolutely want to remain at the 6.4 level, go to http://vault.centos.org/for packages.
Please keep in mind that 6.0, 6.1, 6.2, 6.3 and 6.4 no longer gets any updates, nor any security fix's.
此目录(和 CentOS 的版本)已贬值。对于普通用户,您应该在路径中使用 /6/ 而不是 /6.4/。请参阅此有关 CentOS 发行方案的常见问题:
http://www.centos.org/modules/smartfaq/faq.php?faqid=34
如果您知道自己在做什么,并且绝对想保持在 6.4 级别,请访问http://vault.centos.org/获取软件包。
请记住,6.0、6.1、6.2、6.3 和 6.4 不再获得任何更新,也不再获得任何安全修复。
So, replace /6.4/
with /6/
in the FTP URL or go to http://vault.centos.org
(whichever applies to your case) and you are set. Besides, the last line might be interesting for you :)
因此,更换/6.4/
同/6/
在FTP URL或去http://vault.centos.org
(取适用于您的情况),你设置。此外,最后一行对您来说可能很有趣:)
You should also consider getting the package from a repository, so that you will kept up-to-date with security fixes.
您还应该考虑从存储库中获取包,以便您可以及时了解安全修复程序。