使用kkFileView的问题总结---安装office插件

其实在kkFileView的启动脚本中是包含有安装office插件的脚本的,在install.sh中。但是需要联网,有的服务器没有联网就需要手动安装。

#!/bin/bash
cd /tmp

install_redhat() {
    wget https://kkfileview.keking.cn/Apache_OpenOffice_4.1.6_Linux_x86-64_install-rpm_zh-CN.tar.gz -cO openoffice_rpm.tar.gz && tar zxf /tmp/openoffice_rpm.tar.gz && cd /tmp/zh-CN/RPMS
   if [ $? -eq 0 ];then
     yum install -y libXext.x86_64
     yum groupinstall -y  "X Window System"
     rpm -Uvih *.rpm
     echo 'install desktop service ...'
     rpm -Uvih desktop-integration/openoffice4.1.6-redhat-menus-4.1.6-9790.noarch.rpm
     echo 'install finshed...'
   else
     echo 'download package error...'
   fi
}

install_ubuntu() {
   wget  https://kkfileview.keking.cn/Apache_OpenOffice_4.1.6_Linux_x86-64_install-deb_zh-CN.tar.gz  -cO openoffice_deb.tar.gz && tar zxf /tmp/openoffice_deb.tar.gz && cd /tmp/zh-CN/DEBS
   echo $?
 if [ $? -eq 0 ];then
     apt-get install -y libxrender1
     apt-get install -y libxt6
     apt-get install -y libxext-dev
     apt-get install -y libfreetype6-dev
     dpkg -i *.deb
     echo 'install desktop service ...'
     dpkg -i desktop-integration/openoffice4.1-debian-menus_4.1.6-9790_all.deb
     echo 'install finshed...'
  else
    echo 'download package error...'
 fi
}


if [ -f "/etc/redhat-release" ]; then
  yum install -y wget
  install_redhat
else
  apt-get install -y wget
  install_ubuntu
fi
redhat拆解命令如下:

1.下载 Apache_OpenOffice_4.1.6_Linux_x86-64_install-rpm_zh-CN.tar.gz

https://kkfileview.keking.cn/Apache_OpenOffice_4.1.6_Linux_x86-64_install-rpm_zh-CN.tar.gz

2. 重命名为:openoffice_rpm.tar.gz,上传到相关项目下

3. 解压缩 :tar zxf /tmp/openoffice_rpm.tar.gz


4.切换目录 : cd /tmp/zh-CN/RPMS

5.安装所有rpm包:rpm -Uvih *.rpm

6.安装rpm包 :rpm -Uvih desktop-integration/openoffice4.1.6-redhat-menus-4.1.6-9790.noarch.rpm

启动office

  1.安装完启动,启动命令如下,不加&就只是临时启动:

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

2.查看进程
ps -ef|grep soffice 

 

参考:https://blog.csdn.net/cool_ocean/article/details/110876837

      https://www.cnblogs.com/sujiujiu/p/15370006.html

posted @ 2022-03-02 10:04  ni当像鸟飞往你的山  阅读(1217)  评论(0编辑  收藏  举报