java rpm インストール アンインストール アップデート

javarpmyumでインストール&アンインストール

[astail@localhost ~]$ java -version -bash: java: コマンドが見つかりません [astail@localhost ~]$ ls html.tar.gz jdk-7u40-linux-x64.rpm [astail@localhost ~]$ sudo yum localinstall jdk-7u40-linux-x64.rpm 今回はつけていないオプション --nogpgcheck こちらの記事から 通常、Fedoraリポジトリに登録されているRPMパッケージには、パッケージの出自を証明するためのGPGキーが封入されている。 しかし、個人や企業が作成したRPMにはGPGキーが封入されていないか、されていたとしてもキーを自身のシステムに登録していないので、GPGキーがないというエラーでインストールに失敗してしまう。 このオプションをつけることで、そのGPGキーのチェックを省略できる。もちろん、信頼できるパッケージ以外はインストールしてはいけない。

[astail@localhost ~]$ java -version java version "1.7.0_40" Java(TM) SE Runtime Environment (build 1.7.0_40-b43) Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)

[astail@localhost ~]$ rpm -qi jdk Name : jdk Relocations: /usr/java Version : 1.7.0_40 Vendor: Oracle Corporation Release : fcs Build Date: 2013年08月27日 16時30分28秒 Install Date: 2014年03月12日 15時36分33秒 Build Host: sc14160136.us.oracle.com Group : Development/Tools Source RPM: jdk-1.7.0_40-fcs.src.rpm Size : 201774313 License: http://java.com/license Signature : (none) Packager : Java Software <jre-comments@java.sun.com> URL : URL_REF Summary : Java Platform Standard Edition Development Kit Description : The Java Platform Standard Edition Development Kit (JDK) includes both the runtime environment (Java virtual machine, the Java platform classes and supporting files) and development tools (compilers, debuggers, tool libraries and other tools).

The JDK is a development environment for building applications, applets and components that can be deployed with the Java Platform Standard Edition Runtime Environment.

[astail@localhost ~]$ sudo yum remove jdk [astail@localhost ~]$ java -version -bash: /usr/bin/java: そのようなファイルやディレクトリはありません [astail@localhost ~]$ rpm -qi jdk パッケージ jdk はインストールされていません。

普通の?rpmインストール&アンインストール [astail@localhost ~]$ ls jdk-7u40-linux-x64.rpm jdk-7u51-linux-x64.rpm [astail@localhost ~]$ sudo rpm -ivh jdk-7u40-linux-x64.rpm 準備中... ########################################### [100%] 1:jdk ########################################### [100%] Unpacking JAR files... rt.jar... jsse.jar... charsets.jar... tools.jar... localedata.jar... jfxrt.jar... [astail@localhost ~]$ java -version java version "1.7.0_40" Java(TM) SE Runtime Environment (build 1.7.0_40-b43) Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)

[astail@localhost ~]$ sudo rpm -e jdk [astail@localhost ~]$ java -version -bash: /usr/bin/java: そのようなファイルやディレクトリはありません

javaのアップデートする [astail@localhost ~]$ sudo rpm -ivh jdk-7u40-linux-x64.rpm 準備中... ########################################### [100%] 1:jdk ########################################### [100%] Unpacking JAR files... rt.jar... jsse.jar... charsets.jar... tools.jar... localedata.jar... jfxrt.jar... [astail@localhost ~]$ rpm -qi jdk Name : jdk Relocations: /usr/java Version : 1.7.0_40 Vendor: Oracle Corporation Release : fcs Build Date: 2013年08月27日 16時30分28秒 Install Date: 2014年03月12日 16時11分55秒 Build Host: sc14160136.us.oracle.com Group : Development/Tools Source RPM: jdk-1.7.0_40-fcs.src.rpm Size : 201774313 License: http://java.com/license Signature : (none) Packager : Java Software jre-comments@java.sun.com URL : URL_REF Summary : Java Platform Standard Edition Development Kit Description : The Java Platform Standard Edition Development Kit (JDK) includes both the runtime environment (Java virtual machine, the Java platform classes and supporting files) and development tools (compilers, debuggers, tool libraries and other tools).

The JDK is a development environment for building applications, applets and components that can be deployed with the Java Platform Standard Edition Runtime Environment. [astail@localhost ~]$ sudo rpm -Uvh jdk-7u51-linux-x64.rpm 準備中... ########################################### [100%] 1:jdk ########################################### [100%] Unpacking JAR files... rt.jar... jsse.jar... charsets.jar... tools.jar... localedata.jar... jfxrt.jar... [astail@localhost ~]$ rpm -qi jdk Name : jdk Relocations: /usr/java Version : 1.7.0_51 Vendor: Oracle Corporation Release : fcs Build Date: 2013年12月19日 12時30分24秒 Install Date: 2014年03月12日 16時12分54秒 Build Host: jdk7-lin-amd64 Group : Development/Tools Source RPM: jdk-1.7.0_51-fcs.src.rpm Size : 201995347 License: http://java.com/license Signature : (none) Packager : Java Software jre-comments@java.sun.com URL : URL_REF Summary : Java Platform Standard Edition Development Kit Description : The Java Platform Standard Edition Development Kit (JDK) includes both the runtime environment (Java virtual machine, the Java platform classes and supporting files) and development tools (compilers, debuggers, tool libraries and other tools).

The JDK is a development environment for building applications, applets and components that can be deployed with the Java Platform Standard Edition Runtime Environment.

[astail@localhost ~]$ java -version java version "1.7.0_51" Java(TM) SE Runtime Environment (build 1.7.0_51-b13) Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)

なおyum localinstallした状態で新しいバージョンのものをlocalinstallしてもちゃんとアップデートしてくれた模様 [astail@localhost ~]$ sudo yum localinstall jdk-7u40-linux-x64.rpm Loaded plugins: fastestmirror Setting up Local Package Process Examining jdk-7u40-linux-x64.rpm: 2000:jdk-1.7.0_40-fcs.x86_64 Marking jdk-7u40-linux-x64.rpm to be installed Loading mirror speeds from cached hostfile * base: ftp.riken.jp * epel: ftp.kddilabs.jp * epel-debuginfo: ftp.kddilabs.jp * epel-source: ftp.kddilabs.jp * extras: ftp.riken.jp * updates: ftp.riken.jp Resolving Dependencies --> Running transaction check ---> Package jdk.x86_64 2000:1.7.0_40-fcs will be installed --> Finished Dependency Resolution

Dependencies Resolved


Package Arch Version Repository Size

Installing: jdk x86_64 2000:1.7.0_40-fcs /jdk-7u40-linux-x64 192 M

Transaction Summary

Install 1 Package(s)

Total size: 192 M Installed size: 192 M Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : 2000:jdk-1.7.0_40-fcs.x86_64 1/1 Unpacking JAR files... rt.jar... jsse.jar... charsets.jar... tools.jar... localedata.jar... jfxrt.jar... Verifying : 2000:jdk-1.7.0_40-fcs.x86_64 1/1

Installed: jdk.x86_64 2000:1.7.0_40-fcs

Complete! [astail@localhost ~]$ [astail@localhost ~]$ java -version java version "1.7.0_40" Java(TM) SE Runtime Environment (build 1.7.0_40-b43) Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode) [astail@localhost ~]$ sudo yum localinstall jdk-7u51-linux-x64.rpm Loaded plugins: fastestmirror Setting up Local Package Process Examining jdk-7u51-linux-x64.rpm: 2000:jdk-1.7.0_51-fcs.x86_64 Marking jdk-7u51-linux-x64.rpm as an update to 2000:jdk-1.7.0_40-fcs.x86_64 Loading mirror speeds from cached hostfile * base: ftp.riken.jp * epel: ftp.kddilabs.jp * epel-debuginfo: ftp.kddilabs.jp * epel-source: ftp.kddilabs.jp * extras: ftp.riken.jp * updates: ftp.riken.jp Resolving Dependencies --> Running transaction check ---> Package jdk.x86_64 2000:1.7.0_40-fcs will be updated ---> Package jdk.x86_64 2000:1.7.0_51-fcs will be an update --> Finished Dependency Resolution

Dependencies Resolved


Package Arch Version Repository Size

Updating: jdk x86_64 2000:1.7.0_51-fcs /jdk-7u51-linux-x64 193 M

Transaction Summary

Upgrade 1 Package(s)

Total size: 193 M Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Updating : 2000:jdk-1.7.0_51-fcs.x86_64 1/2 Unpacking JAR files... rt.jar... jsse.jar... charsets.jar... tools.jar... localedata.jar... jfxrt.jar... Cleanup : 2000:jdk-1.7.0_40-fcs.x86_64 2/2 Verifying : 2000:jdk-1.7.0_51-fcs.x86_64 1/2 Verifying : 2000:jdk-1.7.0_40-fcs.x86_64 2/2

Updated: jdk.x86_64 2000:1.7.0_51-fcs

Complete! [astail@localhost ~]$ java -version java version "1.7.0_51" Java(TM) SE Runtime Environment (build 1.7.0_51-b13) Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode) [astail@localhost ~]$ rpm -qi jdk Name : jdk Relocations: /usr/java Version : 1.7.0_51 Vendor: Oracle Corporation Release : fcs Build Date: 2013年12月19日 12時30分24秒 Install Date: 2014年03月12日 16時25分29秒 Build Host: jdk7-lin-amd64 Group : Development/Tools Source RPM: jdk-1.7.0_51-fcs.src.rpm Size : 201995347 License: http://java.com/license Signature : (none) Packager : Java Software jre-comments@java.sun.com URL : URL_REF Summary : Java Platform Standard Edition Development Kit Description : The Java Platform Standard Edition Development Kit (JDK) includes both the runtime environment (Java virtual machine, the Java platform classes and supporting files) and development tools (compilers, debuggers, tool libraries and other tools).

The JDK is a development environment for building applications, applets and components that can be deployed with the Java Platform Standard Edition Runtime Environment.