最近学习了如何在CentOS上安装一些列的软件,OppenOffice便是其中之一。

第一步:环境准备

      由于本方法用到了网络,因此要先确保你的虚拟机是可以连网的,如果大家不知道怎么配置虚拟机IP和连网的话,大家可以参考:这篇博客来学习。

第二步:下载安装包

        要安装OpenOffice需要先下载它的安装包,大家可以去官网下载最新的安装包,当然如果不知道怎样在官网下载的话也可以从:http://pan.baidu.com/s/1skYl2lJ这个网盘地址下载安装包Apache_OpenOffice_4.1.3_Linux_x86-64_install-rpm_zh-CN.tar.gz。(wget方式来下载的话,我试了试太慢,都下不动,还是直接到官网下吧)

第三步:上传到服务器

        下载完安装包之后,我们把它上传到我们的虚拟机(也就是服务器),上传的工具大家可以使用FileZilla工具,如果不知道怎么使用的话,大家可以参考:这篇博客来学习,这篇博客是讲怎样在CentOS安装JDK的,刚好,我们运行OpenOffice需要JDK,先安装好JDK。当然,里面用到了FileZilla工具,我们照着操作就行了。我这里先在root根目录下新建了一个叫zcms的文件夹,创建文件夹的命令是mkdir zcms。我们就把Apache_OpenOffice_4.1.3_Linux_x86-64_install-rpm_zh-CN.tar.gz上传到zcms目录下。

第四步:解压安装包

        上传到服务器之后,我们开始解压安装包,我们就在zcms目录下直接解压,如下所示。

[root@itcast03 zcms]# tar zxvf Apache_OpenOffice_4.1.3_Linux_x86-64_install-rpm_zh-CN.tar.gz

         解压完之后,在zcms目录下会有一个zh-CN文件出现,如下图所示。

antiword centos安装 centos安装office软件_desktop

第五步:安装rpm

前提要能连网啊,不能连网请参考第一步进行操作)。

[root@test zcms]# ls
 Apache_OpenOffice_4.1.3_Linux_x86-64_install-rpm_zh-CN.tar.gz  ffmpeg-3.1.4.tar.bz2       output.mp4  yasm-1.3.0         zh-CN
 ffmpeg-3.1.4                                                   jdk-7u80-linux-x64.tar.gz  weibo.mp4   yasm-1.3.0.tar.gz
 [root@test zcms]# cd zh-CN/
 [root@test zh-CN]# ls
 licenses  readmes  RPMS
 [root@test zh-CN]# cd RPMS/
 [root@test RPMS]# ls
 desktop-integration                                 openoffice-images-4.1.3-9783.x86_64.rpm
 openoffice-4.1.3-9783.x86_64.rpm                    openoffice-impress-4.1.3-9783.x86_64.rpm
 openoffice-base-4.1.3-9783.x86_64.rpm               openoffice-javafilter-4.1.3-9783.x86_64.rpm
 openoffice-brand-base-4.1.3-9783.x86_64.rpm         openoffice-math-4.1.3-9783.x86_64.rpm
 openoffice-brand-calc-4.1.3-9783.x86_64.rpm         openoffice-ogltrans-4.1.3-9783.x86_64.rpm
 openoffice-brand-draw-4.1.3-9783.x86_64.rpm         openoffice-onlineupdate-4.1.3-9783.x86_64.rpm
 openoffice-brand-impress-4.1.3-9783.x86_64.rpm      openoffice-ooofonts-4.1.3-9783.x86_64.rpm
 openoffice-brand-math-4.1.3-9783.x86_64.rpm         openoffice-ooolinguistic-4.1.3-9783.x86_64.rpm
 openoffice-brand-writer-4.1.3-9783.x86_64.rpm       openoffice-pyuno-4.1.3-9783.x86_64.rpm
 openoffice-brand-zh-CN-4.1.3-9783.x86_64.rpm        openoffice-ure-4.1.3-9783.x86_64.rpm
 openoffice-calc-4.1.3-9783.x86_64.rpm               openoffice-writer-4.1.3-9783.x86_64.rpm
 openoffice-core01-4.1.3-9783.x86_64.rpm             openoffice-xsltfilter-4.1.3-9783.x86_64.rpm
 openoffice-core02-4.1.3-9783.x86_64.rpm             openoffice-zh-CN-4.1.3-9783.x86_64.rpm
 openoffice-core03-4.1.3-9783.x86_64.rpm             openoffice-zh-CN-base-4.1.3-9783.x86_64.rpm
 openoffice-core04-4.1.3-9783.x86_64.rpm             openoffice-zh-CN-calc-4.1.3-9783.x86_64.rpm
 openoffice-core05-4.1.3-9783.x86_64.rpm             openoffice-zh-CN-draw-4.1.3-9783.x86_64.rpm
 openoffice-core06-4.1.3-9783.x86_64.rpm             openoffice-zh-CN-help-4.1.3-9783.x86_64.rpm
 openoffice-core07-4.1.3-9783.x86_64.rpm             openoffice-zh-CN-impress-4.1.3-9783.x86_64.rpm
 openoffice-draw-4.1.3-9783.x86_64.rpm               openoffice-zh-CN-math-4.1.3-9783.x86_64.rpm
 openoffice-gnome-integration-4.1.3-9783.x86_64.rpm  openoffice-zh-CN-res-4.1.3-9783.x86_64.rpm
 openoffice-graphicfilter-4.1.3-9783.x86_64.rpm      openoffice-zh-CN-writer-4.1.3-9783.x86_64.rpm
 [root@test RPMS]# yum localinstall *.rpm
 Loaded plugins: fastestmirror, refresh-packagekit, security
 Setting up Local Package Process
 Examining openoffice-4.1.3-9783.x86_64.rpm: openoffice-4.1.3-9783.x86_64
 Marking openoffice-4.1.3-9783.x86_64.rpm to be installed
 Loading mirror speeds from cached hostfile
  * base: mirror.bit.edu.cn
  * extras: mirror.bit.edu.cn
  * updates: mirrors.tuna.tsinghua.edu.cn
 Examining openoffice-base-4.1.3-9783.x86_64.rpm: openoffice-base-4.1.3-9783.x86_64
 Marking openoffice-base-4.1.3-9783.x86_64.rpm to be installed
 Examining openoffice-brand-base-4.1.3-9783.x86_64.rpm: openoffice-brand-base-4.1.3-9783.x86_64
 Marking openoffice-brand-base-4.1.3-9783.x86_64.rpm to be installed

..........此处省去很多安装信息

      安装完上面所有的rpm之后,我们再来安装RPMS/desktop-integration目录下的openoffice4.1.3-redhat-menus-4.1.3-9783.noarch.rpm,我们使用命令yum localinstall openoffice4.1.3-redhat-menus-4.1.3-9783.noarch.rpm来安装,如下所示。

[root@itcast03 RPMS]# cd desktop-integration/
 [root@itcast03 desktop-integration]# ls
 openoffice4.1.3-freedesktop-menus-4.1.3-9783.noarch.rpm  openoffice4.1.3-redhat-menus-4.1.3-9783.noarch.rpm
 openoffice4.1.3-mandriva-menus-4.1.3-9783.noarch.rpm     openoffice4.1.3-suse-menus-4.1.3-9783.noarch.rpm[root@itcast03 desktop-integration]# yum localinstall openoffice4.1.3-redhat-menus-4.1.3-9783.noarch.rpm

第六步:安装完成直接启动Openoffice服务(注意:OpenOffice的运行需要JRE环境,因此要先把JDK安装好)

临时启动:

/opt/openoffice4/program/soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard

一直后台启动:

nohup /opt/openoffice4/program/soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard

第七步:查看服务是否启动(端口8100是否被soffice占用),使用命令:netstat -lnp |grep 8100,显示结果如下所示:

antiword centos安装 centos安装office软件_上传_02

说明:我启动是用的临时启动,运行命令后,程序卡在哪儿了,应该是在监听端口,为了查看服务是否启动,可以先先关掉当前终端并且开启一个新终端(在虚拟机中我们都是打开一个终端进行命令操作,我们关掉当前终端,在桌面右键重新打开一个终端,再进行第七步就可以了)

大功告成!!!!