在CentOS系统上定制化配置LibreOffice的步骤如下:
-
安装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
- 下载LibreOffice的RPM包,例如:
-
配置环境变量:
- 编辑
/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
- 编辑
-
解决中文乱码问题:
- 将Windows字体文件夹复制到Linux系统中:
cp -r C:\Windows\Fonts /usr/share/fonts/chinese
- 刷新字体缓存:
mkfontscale mkfontdir fc-cache -fv
- 验证字体安装:
fc-list :lang=zh
- 将Windows字体文件夹复制到Linux系统中:
-
高级配置:
- 编辑配置文件:
nano ~/.config/libreoffice/4/user/sofficerc
- 修改配置文件以自定义工具栏布局等设置。
- 编辑配置文件:
-
启动LibreOffice服务:
- 以无头模式启动LibreOffice:
libreoffice --headless --accept="socket,host=0.0.0.0,port=8100;urp;" --nofirststartwizard
- 验证端口是否启动成功:
ps -ef | grep 8100
- 以无头模式启动LibreOffice: