在RedHat上安装gcc,java 和 eclipse-rcp

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
RDS MySQL Serverless 高可用系列,价值2615元额度,1个月
简介:

本文全是如何用rpm包在红帽子54上安装gcc,automake,java和eclipse等,不是源代码编译,请大家不要误会了。

其实通过rpm包安装东西很简单,麻烦的是有很多rpm是要根据顺序进行先后安装的,你找半天才能追溯到要先装哪一个rpm包,非常繁琐。

所以这篇文章就是我在实际中记录了正确的先后顺序,跟着安装就可以了,免去了不断查找依赖rpm的麻烦。

废话不说,这是我的实践帖,没有太多时间整理,当中也不免废话,放在这里权当做个笔记吧。

 

1         Install gcc and automake:

1) For gcc-4.1.2.44:

rpm -ivh libgomp-4.3.2-7.el5.x86_64.rpm

rpm -ivh kernel-headers-2.6.18-128.el5.x86_64.rpm

rpm -ivh glibc-headers-2.5-34.x86_64.rpm

rpm -ivh glibc-devel-2.5-34.x86_64.rpm

rpm -ivh gcc-4.1.2-44.el5.x86_64.rpm

  

2) After step 1, for gcc-c++-4.1.2.44

rpm -ivh libstdc++-devel-4.1.2-44.el5.x86_64.rpm

rpm -ivh gcc-c++-4.1.2-44.el5.x86_64.rpm

 

3. After step 2, for automake-1.9.6-2.1.noarch.rpm

rpm -ivh imake-1.0.2-3.x86_64.rpm

rpm -ivh autoconf-2.59-12.noarch.rpm

rpm -ivh automake-1.9.6-2.1.noarch.rpm

2         java && mysql:

红帽子光盘里面有如下的java RPM包:

java-1.4.2-gcj-compat-1.4.2.0-40jpp.115.x86_64.rpm

java-1.4.2-gcj-compat-devel-1.4.2.0-40jpp.115.i386.rpm

java-1.4.2-gcj-compat-devel-1.4.2.0-40jpp.115.x86_64.rpm

java-1.4.2-gcj-compat-javadoc-1.4.2.0-40jpp.115.x86_64.rpm

java-1.4.2-gcj-compat-src-1.4.2.0-40jpp.115.x86_64.rpm

java-1.6.0-openjdk-1.6.0.0-1.2.b09.el5.x86_64.rpm

java-1.6.0-openjdk-demo-1.6.0.0-1.2.b09.el5.x86_64.rpm

java-1.6.0-openjdk-devel-1.6.0.0-1.2.b09.el5.x86_64.rpm

java-1.6.0-openjdk-javadoc-1.6.0.0-1.2.b09.el5.x86_64.rpm

java-1.6.0-openjdk-src-1.6.0.0-1.2.b09.el5.x86_64.rpm

javacc-4.0-3jpp.3.x86_64.rpm

javacc-demo-4.0-3jpp.3.x86_64.rpm

javacc-manual-4.0-3jpp.3.x86_64.rpm

java_cup-0.10-0.k.6jpp.1.x86_64.rpm

java_cup-javadoc-0.10-0.k.6jpp.1.x86_64.rpm

java_cup-manual-0.10-0.k.6jpp.1.x86_64.rpm

 

红帽子光盘里面有如下的MySQL RPM包:

mysql-5.0.77-3.el5.i386.rpm

mysql-5.0.77-3.el5.x86_64.rpm

mysql-bench-5.0.77-3.el5.x86_64.rpm

mysql-connector-odbc-3.51.26r1127-1.el5.x86_64.rpm

mysql-devel-5.0.77-3.el5.i386.rpm

mysql-devel-5.0.77-3.el5.x86_64.rpm

mysql-server-5.0.77-3.el5.x86_64.rpm

mysql-test-5.0.77-3.el5.x86_64.rpm

 

2.1       to install mysql-server-5.0.77-3.el5.x86_64.rpm:

=====================================================================

如果是MySQL-server-community-5.1.53-1.rhel5.x86_64.rpm(即community版本),就不需要后面那些prerequisite,连mysql-5.****都不需要,安装MySQL-server-community-5.1.53-1.rhel5.x86_64.rpm后,有提示为:

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

To do so, start the server, then issue the following commands:

 

/usr/bin/mysqladmin -u root password 'new-password'

/usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'

 

Alternatively you can run:

/usr/bin/mysql_secure_installation

 

which will also give you the option of removing the test

databases and anonymous user created by default.  This is

strongly recommended for production servers.

See the manual for more instructions.

Please report any problems with the /usr/bin/mysqlbug script!

 

Starting MySQL.[  OK  ]

Giving mysqld 2 seconds to start

=====================================================================

 

perl-DBD-MySQL and mysql is needed by mysql-server-5.0.77-3.el5.x86_64

 

first:

[root@localhost Server]# rpm -ivh mysql-5.0.77-3.el5.x86_64.rpm

warning: mysql-5.0.77-3.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

error: Failed dependencies:

        perl(DBI) is needed by mysql-5.0.77-3.el5.x86_64

 

 

then install rpm -ivh perl-DBI-1.52-2.el5.x86_64.rpm,

then mysql-5.0.77-3.el5.x86_64.rpm is ok.

 

Second:

rpm -ivh perl-DBD-MySQL-3.0007-2.el5.x86_64.rpm

 

then mysql-server-5.0.77-3.el5.x86_64.rpm is ok.

3         Get eclipse-rcp-3.2.1-19.el5.x86_64.rpm and eclipse-rcp-sdk-3.2.1-19.el5.x86_64.rpm

About rcp: http://www.enet.com.cn/article/2007/1023/A20071023879905.shtml , http://derekop.javaeye.com/blog/609087 , http://www.enet.com.cn/article/2007/0320/A20070320492442.shtml

3.1       [root@localhost Server]# rpm -ivh eclipse-rcp-3.2.1-19.el5.x86_64.rpm

warning: eclipse-rcp-3.2.1-19.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

error: Failed dependencies:

        /usr/bin/rebuild-gcj-db is needed by eclipse-rcp-3.2.1-19.el5.x86_64

        /usr/lib64/eclipse/plugins/org.eclipse.swt.gtk.linux.x86_64_3.2.1.v3235.jar is needed by eclipse-rcp-3.2.1-19.el5.x86_64

        java-gcj-compat >= 1.0.64 is needed by eclipse-rcp-3.2.1-19.el5.x86_64

        libgcj >= 4.0.2 is needed by eclipse-rcp-3.2.1-19.el5.x86_64

        libgcj_bc.so.1()(64bit) is needed by eclipse-rcp-3.2.1-19.el5.x86_64

        libswt3-gtk2 = 1:3.2.1-19.el5 is needed by eclipse-rcp-3.2.1-19.el5.x86_64
 

rebuild-gcj-db is in gcj (GNU compiler for Java), then you need:

about gcj: http://blogs.gaixie.org/tommy/?p=46 and http://wenku.baidu.com/view/b8941223192e45361066f5b0.html

3.2       get gcc-java-4.1.2-46.el5.x86_64.rpm:

3.2.1       [root@localhost Server]# rpm -ivh  gcc-java-4.1.2-46.el5.x86_64.rpm

warning: gcc-java-4.1.2-46.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

error: Failed dependencies:

        libgcj = 4.1.2-46.el5 is needed by gcc-java-4.1.2-46.el5.x86_64

        libgcj-devel = 4.1.2-46.el5 is needed by gcc-java-4.1.2-46.el5.x86_64

        libgcj-tools.so.7rh()(64bit) is needed by gcc-java-4.1.2-46.el5.x86_64

        libgcj.so.7rh()(64bit) is needed by gcc-java-4.1.2-46.el5.x86_64

        libgij.so.7rh()(64bit) is needed by gcc-java-4.1.2-46.el5.x86_64

 

then

3.2.2       [root@localhost Server]# rpm -ivh libgcj-4.1.2-46.el5.x86_64.rpm

warning: libgcj-4.1.2-46.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing...                ########################################### [100%]

   1:libgcj                 ########################################### [100%]

3.2.3       [root@localhost Server]# rpm -ivh libgcj-devel-4.1.2-46.el5.x86_64.rpm

warning: libgcj-devel-4.1.2-46.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

error: Failed dependencies:

        zlib-devel is needed by libgcj-devel-4.1.2-46.el5.x86_64

        /usr/lib64/libz.so is needed by libgcj-devel-4.1.2-46.el5.x86_64

[root@localhost Server]# rpm -ivh zlib-devel-1.2.3-3.x86_64.rpm

warning: zlib-devel-1.2.3-3.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing...                ########################################### [100%]

   1:zlib-devel             ########################################### [100%]

[root@localhost Server]#

[root@localhost Server]# rpm -ivh libgcj-devel-4.1.2-46.el5.x86_64.rpm

warning: libgcj-devel-4.1.2-46.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing...                ########################################### [100%]

   1:libgcj-devel           ########################################### [100%]

 

 

Then gcc-java-4.1.2-46.el5.x86_64.rpm is ok.

 

3.3       Get libswt3-gtk2-3.2.1-19.el5.x86_64.rpm

[root@localhost Server]# rpm -ivh libswt3-gtk2-3.2.1-19.el5.x86_64.rpm

warning: libswt3-gtk2-3.2.1-19.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

error: Failed dependencies:

        /usr/bin/rebuild-gcj-db is needed by libswt3-gtk2-3.2.1-19.el5.x86_64

        java-gcj-compat >= 1.0.64 is needed by libswt3-gtk2-3.2.1-19.el5.x86_64

 

in rh5.4 dvd, there only java-1.4.2-gcj-* packages, no for java-1.6.0.

and java-1.4.2-gcj-compat-1.4.2.0-40jpp.115.x86_64.rpm need jpackage-utils in dvd.

 

too many to do in a cycle.

 

So you should use –nodeps option now.

 

 

Follow my steps:

3.3.1       [root@localhost Server]# rpm -ivh java-1.4.2-gcj-compat-1.4.2.0-40jpp.115.x86_64.rpm

warning: java-1.4.2-gcj-compat-1.4.2.0-40jpp.115.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

error: Failed dependencies:

        gjdoc is needed by java-1.4.2-gcj-compat-1.4.2.0-40jpp.115.x86_64

now you use:

rpm -ihv --nodeps antlr-2.7.6-4jpp.2.x86_64.rpm (antlr need by gjdoc)

rpm -ivh --nodeps gjdoc-0.7.7-12.el5.x86_64.rpm

now  java-1.4.2-gcj-compat-1.4.2.0-40jpp.115.x86_64.rpm  is ok.

 

Then rpm -ivh libswt3-gtk2-3.2.1-19.el5.x86_64.rpm is ok.

 

Then rpm -ivh eclipse-rcp-3.2.1-19.el5.x86_64.rpm is ok J

 

Also, then eclipse-rcp-sdk-3.2.1-19.el5.x86_64.rpm can be installed.






本文转自 xkdcc 51CTO博客,原文链接:http://blog.51cto.com/brantc/514899,如需转载请自行联系原作者
相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
4天前
|
Java Maven
【已解决】MAC安装maven,The JAVA_HOME environment variable is not defined correctly, this environment
【已解决】MAC安装maven,The JAVA_HOME environment variable is not defined correctly, this environment
9 0
|
5天前
|
Oracle Java 关系型数据库
JAVA入门: 编程环境安装
JAVA入门: 编程环境安装
|
10天前
蓝易云 - MyEclipse6.5安装m2eclipse方法
注意:由于MyEclipse 6.5是一个较旧的版本,可能无法支持最新版本的m2eclipse插件,因此在下载时,请尽量选择与MyEclipse 6.5兼容的m2eclipse版本。
5 0
|
11天前
|
Oracle Java 关系型数据库
Java入门——开发环境、入门程序(搭建Java开发环境、安装JDK 验证、JDK、编写代码、编译代码、运行代码)
Java入门——开发环境、入门程序(搭建Java开发环境、安装JDK 验证、JDK、编写代码、编译代码、运行代码)
20 3
|
13天前
|
Java
树莓派安装java jdk8
树莓派安装java jdk8
|
13天前
|
Ubuntu Java Linux
Linux centos7 ubuntu 一键安装Java JDK 脚本 shell 脚本
Linux centos7 ubuntu 一键安装Java JDK 脚本 shell 脚本
|
13天前
|
Ubuntu Oracle Java
Linux|如何安装 Java
Linux|如何安装 Java
13 0
|
15天前
|
IDE Java 开发工具
06. 【Java教程】Java 集成开发环境 - Eclipse
06. 【Java教程】Java 集成开发环境 - Eclipse
39 1
|
15天前
|
Oracle Java 关系型数据库
04. 【Java教程】在 Linux 上安装 Java
04. 【Java教程】在 Linux 上安装 Java
15 0
|
15天前
|
Java Shell 开发工具
03. 【Java教程】在 MacOS 上安装 Java
03. 【Java教程】在 MacOS 上安装 Java
12 1