LINUX下安装libreoffice程序
创始人
2024-11-22 06:34:39
0

一、libreoffice安装验证

1、官网下载安装

Download LibreOffice | LibreOffice - Free Office Suite - Based on OpenOffice - Compatible with Microsoft

我下载的是7.5.3.2

https://downloadarchive.documentfoundation.org/libreoffice/old/7.5.3.2/rpm/x86_64/LibreOffice_7.5.3.2_Linux_x86-64_rpm.tar.gz 

2、解压缩

tar -zxvf LibreOffice_7.5.3.2_Linux_x86-64_rpm.tar.gz

3、卸载旧版本

sudo yum erase libreoffice\*

4、安装

 yum install -y libSM.x86_64 libXrender.x86_64  libXext.x86_64  yum groupinstall -y  "X Window System"  yum localinstall RPMS/*.rpm   或 $ su -c yum install *.rpm  即 将解压后文件夹RPMS下的所有rpm文件全部安装即可

*5、环境变量配置

如果报command not found,则需vim文档去配置(添加到文档末即可)
    vim /etc/profile

#libreoffice export LibreOffice_PATH=/opt/libreoffice7.5/program export PATH=$LibreOffice_PATH:$PATH

    执行命令刷新缓存
      source /etc/profile

6、验证LibreOffice是否可用


   命令:libreoffice7.5 --version

   ①出现LibreOffice 7.5.3.2 9f56dff12ba03b9acd7730a5a481eea045e468f3 表示正常执行显示版本号,说明安装成功;

   ②若提示缺少so文件的话,需要安装对应的依赖文件(如下几种示例):

*常见的异常示例: /opt/libreoffice7.5/program/soffice.bin: /lib64/libdbus-1.so.3: no version information available (required by /opt/libreoffice7.5/program/libmergedlo.so) /opt/libreoffice7.5/program/soffice.bin: /lib64/libnss3.so: version `NSS_3.34' not found (required by /opt/libreoffice7.5/program/libcurl.so.4)  /opt/libreoffice7.5/program/soffice.bin: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory /opt/libreoffice7.5/program/soffice.bin: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory  #处理方式:拷贝缺少的.so文件: (依据下面标题二中:依赖库的获取方式得到对应的so文件)     拷贝/opt/libcurl/lib下面的 libcurl.so.4 到  /opt/libreoffice7.5/program/下面    拷贝/opt/openssl/lib下面的 libssl.so.1.1 到  /opt/libreoffice7.5/program/下面    拷贝/opt/openssl/lib下面的 libcrypto.so.1.1 到  /opt/libreoffice7.5/program/下面

7.启动项目

/opt/libreoffice7.5/program/soffice --headless --accept="  socket,host=127.0.0.1,port=2003;urp;"- -nofirststartwizard &

8.验证项目

soffice --headless --convert-to pdf /home/usr/apache-tomcat-8.5.87/temp/文档.docx --outdir /home/usr/apache-tomcat-8.5.87/temp/

二、依赖库的获取-----(参考用)

1、安装常见依赖库文件

yum install cairo -y yum install cups-libs -y yum install libSM -y

    *在这些依赖库文件之中,“libcurl.so.4”库文件的安装过程比较复杂,需要编译安装libcurl才能完成。

2、安装libcurl.so.4库文件

(1)下载安装openssl源代码,
    https://github.com/openssl/openssl/archive/OpenSSL_1_1_1g.zip
    
(2)创建安装目录:

mkdir /opt/openssl

(3)解压所代码压缩包。

unzip openssl-OpenSSL_1_1_1g.zip

(4)编译配置、安装。

cd openssl-OpenSSL_1_1_1g/ ./config --prefix=/opt/openssl --shared make && make install

(5)下载curl源代码,curl - Download ,
    https://curl.se/download.html
    
(6)创建安装目录:

 mkdir /opt/libcurl

(7)解压源代码压缩包。
 

 tar -zxvf curl-8.7.1.tar.gz

    
(8)编译配置、安装。

cd curl-7.85.0 ./configure --prefix=/opt/libcurl --with-ssl=/opt/openssl make && make install

(9)将libcurl.so.4库文件拷贝至/opt/libreoffice7.5/program目录下,覆盖原libcurl.so.4文件。

cp /opt/libcurl/lib/libcurl.so.4 /opt/libreoffice7.5/program/libcurl.so.4     或 ln -s /opt/libcurl/lib/libcurl.so.4 /opt/libreoffice7.5/program/libcurl.so.4

3、创建一个软链接

ln -s /opt/libreoffice7.5/program/soffice /usr/bin/libreoffice 或 ln -s /opt/libreoffice7.5/program/soffice /usr/local/lib64/libreoffice

三、安装中文字体----(若乱码没有中文字体时)


1、下载字体安装包

字体安装包下载

链接: https://pan.baidu.com/s/1W4Zj11A3eQcRYMC8RvIF4A

提取码: 6666

2、解压fonts.zip

unzip fonts.zip  -d /usr/share/fonts/

3、进入目录

cd /usr/share/fonts

4、如果没有这个目录安装

yum -y install fontconfig

5、解压fonts.zip

unzip fonts.zip  -d /usr/share/fonts/     #如果没有unzip指令会报错 yum install -y unzip zip  #安装unzip  

6、执行操作

    命令:mkfontscale 

*如果报错没有,则需要安装  yum install mkfontscale  #安装 mkfontscale mkfontdir fc-cache

相关内容

热门资讯

科普!金花链接房卡如何购买,微... 微信游戏中心:牛牛房卡,添加微信【55051770】,进入游戏中心或相关小程序,搜索“微信牛牛房卡”...
分享!微信群链接拼三张房卡/人... 拼三张是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:33699510许多玩家在游戏中会购买房卡来享...
科普!微信里金花房卡卖家联系方... 微信游戏中心:大牌九房卡,添加微信【33903369】,进入游戏中心或相关小程序,搜索“微信大牌九房...
一分钟了解“微信链接斗牛房卡多... 新众亿金花是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:160470940许多玩家在游戏中会购买房...
科普!金花房卡从哪买的,拼三张... 微信游戏中心:拼三张房卡,添加微信【8488009】,进入游戏中心或相关小程序,搜索“微信拼三张房卡...
微信上玩炸金花冲房卡联系方式/... 牛牛是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:44346008许多玩家在游戏中会购买房卡来享受...
科普!微信炸金花链接房卡,微信... 微信游戏中心:炸金花房卡,添加微信【55051770】,进入游戏中心或相关小程序,搜索“微信炸金花房...
分享!微信炸金花房卡怎么开房间... 炸金花是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:33699510许多玩家在游戏中会购买房卡来享...
微信牛牛房卡链接哪里有/炸金花... 牛牛是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:160470940许多玩家在游戏中会购买房卡来享...
科普!微信上玩炸金花房间怎么开... 微信游戏中心:拼三张房卡,添加微信【33903369】,进入游戏中心或相关小程序,搜索“微信拼三张房...
一分钟推荐“微信上金花房卡怎么... 悠悠大厅是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:160470940许多玩家在游戏中会购买房卡...
科普!怎么开炸金花房卡链接,购... 微信游戏中心:炸金花房卡,添加微信【8488009】,进入游戏中心或相关小程序,搜索“微信炸金花房卡...
科技实测!金花房卡批发价山竹众... 今 日消息,山竹众娱房卡添加微信33549083 苹果今日发布了 iOS 16.1 正式版更新,简单...
分享!微信炸金花从哪里购买房卡... 炸金花是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:33699510许多玩家在游戏中会购买房卡来享...
玩家攻略,斗牛房间怎么创建的海... 海神众娱房卡更多详情添加微:33549083、 2、在商城页面中选择房卡选项。 3、根...
科普!微信里玩炸金花房卡链接充... 微信游戏中心:炸金花房卡,添加微信【55051770】,进入游戏中心或相关小程序,搜索“微信炸金花房...
正版金花房卡批发渠道/可以一起... 牛牛是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:160470940许多玩家在游戏中会购买房卡来享...
重大通报,金花充值房卡嫦娥大厅... 重大通报,金花充值房卡嫦娥大厅/房卡怎么搞嫦娥大厅是一款非常受欢迎的游戏,咨询房/卡添加微信:883...
我来教你/金花微信链接市场价格... 微信游戏中心:新大圣/新道游房卡在哪里买打开微信,添加客服微信【88355042】,进入游戏中心或相...
科普!微信金花房卡充值购买,斗... 微信游戏中心:斗牛房卡,添加微信【33903369】,进入游戏中心或相关小程序,搜索“微信斗牛房卡”...