温馨提示×

centos liboffice定制化配置指南

小樊
127
2025-02-12 00:06:14
栏目: 智能运维

在CentOS系统上定制化配置LibreOffice的步骤如下:

  1. 安装LibreOffice

    • 下载LibreOffice的RPM包,例如:
      wget http://mirrors.ustc.edu.cn/tdf/libreoffice/stable/6.2.8/rpm/x86_64/LibreOffice_6.2.8_Linux_x86-64_rpm.tar.gz 
    • 解压RPM包:
      tar -zxvf LibreOffice_6.2.8_Linux_x86-64_rpm.tar.gz -C /usr/local 
    • 进入解压后的目录并安装:
      cd /usr/local/LibreOffice_6.2.8.2_Linux_x86-64_rpm/RPMS/ sudo yum localinstall *.rpm 
  2. 配置环境变量

    • 编辑 /etc/profile 文件,添加以下内容:
      export LibreOffice_PATH=/usr/local/LibreOffice_6.2.8.2_Linux_x86-64_rpm/program export PATH=$LibreOffice_PATH:$PATH 
    • 使配置生效:
      source /etc/profile 
  3. 解决中文乱码问题

    • 将Windows字体文件夹复制到Linux系统中:
      cp -r C:\Windows\Fonts /usr/share/fonts/chinese 
    • 刷新字体缓存:
      mkfontscale mkfontdir fc-cache -fv 
    • 验证字体安装:
      fc-list :lang=zh 
  4. 高级配置

    • 编辑配置文件:
      nano ~/.config/libreoffice/4/user/sofficerc 
    • 修改配置文件以自定义工具栏布局等设置。
  5. 启动LibreOffice服务

    • 以无头模式启动LibreOffice:
      libreoffice --headless --accept="socket,host=0.0.0.0,port=8100;urp;" --nofirststartwizard 
    • 验证端口是否启动成功:
      ps -ef | grep 8100 

0