{"id":28344,"date":"2023-09-18T02:16:31","date_gmt":"2023-01-21T08:35:56","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e5%ae%89%e8%a3%85unoserver%e3%80%82-2\/"},"modified":"2025-08-12T07:41:13","modified_gmt":"2025-08-11T23:41:13","slug":"%e5%9c%a8centos%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e5%ae%89%e8%a3%85unoserver%e3%80%82-2","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e5%ae%89%e8%a3%85unoserver%e3%80%82-2\/","title":{"rendered":"\u5728CentOS\u670d\u52a1\u5668\u4e0a\u5b89\u88c5unoserver"},"content":{"rendered":"<p>\u9019\u662f2023\u5e74LibreOffice\u79d1\u6280\u964d\u4e16\u7d00\u66c6\u7684\u7b2c\u4e03\u7bc7\u6587\u7ae0\u3002<\/p>\n<h1>\u4e00\u500bunoserver\u662f\u6307LibreOffice\u5177\u6709\u6279\u91cf\u542f\u52a8\u5e76\u8f6c\u6362\u6587\u6863\u6587\u4ef6\u683c\u5f0f\u7684\u529f\u80fd\u3002<\/p>\n<pre class=\"post-pre\"><code>$ libreoffice --headless --convert-to pdf sample.odt\r\n<\/code><\/pre>\n<p>\u4f5c\u4e3a\u53ef\u80fd\u7684\u8f93\u5165\u683c\u5f0f\uff0c\u9664\u4e86LibreOffice\u7684\u672c\u673aOpenDocument\u683c\u5f0f\u5916\uff0c\u8fd8\u5305\u62ec\u51e0\u4e4e\u6240\u6709LibreOffice\u53ef\u4ee5\u8bfb\u53d6\u7684\u5e38\u89c1\u6587\u6863\u683c\u5f0f\uff08\u5982DOCX\uff09\u548c\u56fe\u50cf\u683c\u5f0f\uff08\u5982PNG\uff09\u3002\u5efa\u8bae\u67e5\u770b\u7ef4\u57fa\u767e\u79d1\u7684\u6587\u7ae0\u4ee5\u83b7\u53d6\u66f4\u8be6\u7ec6\u4fe1\u606f\u3002<\/p>\n<p>\u5728\u5355\u6b21\u8f6c\u6362\u4efb\u52a1\u4e2d\uff0c\u8fd9\u79cd\u65b9\u6cd5\u662f\u6ca1\u6709\u95ee\u9898\u7684\u3002\u4f46\u662f\uff0c\u4f5c\u4e3a\u63d0\u4f9b\u8f6c\u6362\u670d\u52a1\u7684\u670d\u52a1\u5668\u7528\u9014\uff0c\u6bcf\u6b21\u90fd\u542f\u52a8LibreOffice\u4f1a\u4ea7\u751f\u4e00\u5b9a\u7684\u6210\u672c\u3002\u4e3a\u4e86\u51cf\u5c11\u542f\u52a8\u5f00\u9500\uff0cunoserver\u662f\u4e00\u4e2a\u5de5\u5177\uff0c\u53ef\u4ee5\u8ba9LibreOffice\u6301\u7eed\u8fd0\u884c\u3002\u5f53\u5728\u670d\u52a1\u5668\u4e0a\u542f\u52a8unoserver\uff0c\u5ba2\u6237\u7aef\u673a\u5668\u53ef\u4ee5\u4f7f\u7528unoconvert\u547d\u4ee4\u8fdb\u884c\u8f6c\u6362\u3002<\/p>\n<p>\u6211\u5011\u5c07\u6309\u7167\u4ee5\u4e0b\u6b65\u9a5f\uff0c\u76e1\u53ef\u80fd\u7c21\u55ae\u5730\u89e3\u91cb\u5982\u4f55\u5728CentOS\u4e0a\u5b89\u88dd\u4e26\u904b\u884cunoserver\u3002\u6211\u5011\u5728CentOS Stream 8\uff08\u4ee5\u53caOracle Linux 8.8\uff09\u548cCentOS Stream 9\uff08\u6b64\u8655\u7701\u7565\u300cStream\u300d\uff09\uff08\u7686\u7528\u4f5c\u4f3a\u670d\u5668\u5b89\u88dd\uff09\u4e0a\u9032\u884c\u4e86\u9a57\u8b49\u3002\u8acb\u6ce8\u610f\uff0c\u6bcf\u500b\u5957\u4ef6\u7684\u53ef\u7528\u6027\u548c\u7248\u672c\u865f\u662f\u6839\u64da\u9a57\u8b49\u6642\u7684\u60c5\u6cc1\u800c\u5b9a\u3002<\/p>\n<p>\u8fd8\u6709\u4e00\u4e2a\u7531\u540c\u4e00\u4f5c\u8005\u5f00\u53d1\u7684\u7528\u4e8e\u76f8\u540c\u76ee\u7684\u7684\u5de5\u5177\u53eb\u505aunoconv\uff0c\u5728\u8fd9\u91cc\u4e0d\u4e88\u8003\u8651\uff0c\u56e0\u4e3a\u8be5\u5de5\u5177\u5df2\u7ecf\u8fc7\u65f6\uff0c\u5e76\u4e14\u5df2\u7ecf\u8d85\u8fc7\u4e24\u5e74\u6ca1\u6709\u66f4\u65b0\uff08\u6211\u4eec\u5df2\u7ecf\u786e\u8ba4\u5b83\u53ef\u4ee5\u6b63\u5e38\u8fd0\u884c\uff09\u3002<\/p>\n<h1>\u51c6\u5907Python<\/p>\n<h2>CentOS 8 &#8212;- \u5b89\u88c5Python39CentOS 8\u7684platform-python\u7248\u672c\u4e3a3.6.8\uff0c\u4f46\u5728\u4f7f\u7528pip\u5b89\u88c5unoserver\u65f6\u4f1a\u51fa\u73b0\u4ee5\u4e0b\u9519\u8bef\u3002\u5c3d\u7ba1unoserver\u6e90\u4ee3\u7801\u4e2d\u7684pyproject.toml\u6587\u4ef6\u91cc\u5199\u660e\u4e86requires-python = &#8220;&gt;= 3.8&#8243;\uff0c\u4f46\u4e3a\u4ec0\u4e48\u4f1a\u663e\u793a&#8217;&gt;= 3.7&#8217;\uff0c\u6211\u4e0d\u77e5\u9053\u3002<\/p>\n<pre class=\"post-pre\"><code># \/usr\/libexec\/platform-python -m pip install unoserver\r\n...\r\nunoserver requires Python '&gt;= 3.7' but the running Python is 3.6.8\r\n<\/code><\/pre>\n<p>\u5982\u679c\u4ece\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u5e76\u5b89\u88c5\u6700\u65b0\u7684LibreOffice\uff0c\u5b83\u4f1a\u9644\u5e26Python 3.8\uff0c\u56e0\u6b64\u60a8\u53ef\u4ee5\u4f7f\u7528\u5b83\u6765\u6ee1\u8db3\u6761\u4ef6\u3002\u4f46\u662f\uff0c\u8fd9\u4e2aPython\u7248\u672c\u6ca1\u6709pip\u548censurepip\uff0c\u56e0\u6b64\u9700\u8981\u83b7\u53d6get-pip.py\u5e76\u5b89\u88c5pip\u7b49\uff0c\u6709\u70b9\u4e0d\u65b9\u4fbf\u3002<\/p>\n<p>\u8003\u8651\u5230\u53ef\u80fd\u8fd8\u5b58\u5728\u5176\u4ed6\u9700\u8981\u65b0\u7248\u672cPython\u7684\u60c5\u51b5\uff0c\u4e3a\u4e86\u4e0eCentOS 9\u642d\u914d\uff0c\u6211\u4eec\u5c06\u5728\u6b64\u5b89\u88c5Python 3.9\uff0c\u5176\u5c06\u4e0e\u9ed8\u8ba4\u4ed3\u5e93\u4e00\u540c\u5b89\u88c5pip3\u3002\u5c3d\u7ba13.11\u4e5f\u662f\u53ef\u884c\u7684\uff0c\u4f46\u5c1a\u672a\u7ecf\u8fc7\u9a8c\u8bc1\u3002<\/p>\n<pre class=\"post-pre\"><code># dnf install -y python39\r\n<\/code><\/pre>\n<p>\u987a\u4fbf\u63d0\u4e00\u4e0b\uff0c\u6700\u65b0\u7684LibreOffice\u9644\u5e26\u7684Python\u4e2d\u5b89\u88c5pip\uff0c\u5e76\u4f7f\u7528\u5b83\u5b89\u88c5\u67d0\u4e9b\u5305\u65f6\uff0c\u811a\u672c\u7684Shebang\u6307\u5b9a\u4e86program\/python.bin\u3002\u7136\u800c\uff0c\u8fd9\u4e2a\u4e8c\u8fdb\u5236\u6587\u4ef6\u6ca1\u6709\u9884\u5148\u8bbe\u7f6e\u6240\u9700\u7684\u8def\u5f84\uff0c\u6240\u4ee5\u65e0\u6cd5\u76f4\u63a5\u542f\u52a8\u811a\u672c\u3002\u4f60\u9700\u8981\u4fee\u6539\u811a\u672c\u4ee5\u6307\u5b9aprogram\/python\uff08sh\u811a\u672c\uff09\uff0c\u6216\u8005\u5728\u811a\u672c\u542f\u52a8\u4e4b\u524d\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u6765\u5305\u88c5\u5b83\u3002\u5728\u66f4\u65b0LibreOffice\u7248\u672c\u65f6\u4e5f\u9700\u8981\u6ce8\u610f\u3002<\/p>\n<p>\u5176\u5b9e\uff0c\u5728unoserver\u7684\u60c5\u51b5\u4e0b\uff0c\u7531\u4e8e\u5fc5\u987b\u8fdb\u884c\u73af\u5883\u53d8\u91cf\u7684\u8bbe\u7f6e\uff0c\u6240\u4ee5\u8fd9\u4e2a\u90e8\u5206\u7684\u5de5\u4f5c\u91cf\u5e76\u6ca1\u6709\u592a\u5927\u5dee\u522b\u3002\u4f46\u5982\u679c\u901a\u8fc7systemd\u542f\u52a8\uff0c\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u5b8c\u6210\u73af\u5883\u53d8\u91cf\u7684\u8bbe\u7f6e\u3002<\/p>\n<h2>CentOS 9 &#8212; \u5b89\u88c5pipCentOS 8 \u7684 platform-python \u7248\u672c\u662f 3.9.18\uff0c\u6240\u4ee5\u6ee1\u8db3\u6761\u4ef6\u3002\u7136\u800c\uff0cpip \u5c1a\u672a\u5b89\u88c5\uff0c\u5982\u679c\u8fd8\u6ca1\u6709\u5b89\u88c5\uff0c\u9700\u8981\u5148\u5b89\u88c5\u3002<\/p>\n<pre class=\"post-pre\"><code># dnf install -y python3-pip\r\n<\/code><\/pre>\n<h1>\u51c6\u5907LibreOffice<\/p>\n<h2>\u5f9e\u6a19\u6e96\u7684AppStream\u5b89\u88ddLibreOffice\u3002\u5982\u679c\u6309\u7167\u4e0b\u8ff0\u65b9\u5f0f\u8fdb\u884c\u64cd\u4f5c\uff0c\u5c06\u5728CentOS 8\u4e0a\u5b89\u88c5LibreOffice 6.4.7.2\uff0c\u5728CentOS 9\u4e0a\u5b89\u88c5LibreOffice 7.1.8.1\u3002\u7136\u800c\uff0c\u5f53\u4f7f\u7528LibreOffice 6.4\u8fdb\u884c\u8f6c\u6362\u65f6\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0\u65e0\u6cd5\u63a7\u5236\u7684\u60c5\u51b5\uff0c\u5bfc\u81f4\u7cfb\u7edf\u5d29\u6e83\u5e76\u53ef\u80fd\u6210\u4e3a\u62d2\u7edd\u670d\u52a1\u653b\u51fb\uff08DoS\uff09\u3002\u867d\u7136\u57287\u7cfb\u5217\u4e2d\u53ef\u80fd\u5b58\u5728\u7c7b\u4f3c\u60c5\u51b5\uff0c\u4f46\u76ee\u524d\u5c1a\u672a\u53d1\u73b0\u3002\u56e0\u6b64\uff0c\u5efa\u8bae\u5728CentOS 8\u4e0a\u8df3\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u5e76\u5b89\u88c5\u6700\u65b0\u7684LibreOffice\u3002<\/p>\n<pre class=\"post-pre\"><code># dnf install -y libreoffice\r\n<\/code><\/pre>\n<p>\u4e0d\u9700\u8981\u5b89\u88c5 libreoffice-langpack-ja\uff08\u4f46\u5b89\u88c5\u4e5f\u6ca1\u6709\u95ee\u9898\uff09\u3002<\/p>\n<p>\u5728CentOS 8\u4e0a\uff0clibreoffice-pyuno\u7684\u76f8\u5173\u6587\u4ef6\u88ab\u5b89\u88c5\u5728platform-python\u7684site-packages\u76ee\u5f55\u4e2d\u3002\u7531\u4e8eCentOS 8\u4f7f\u7528\u7684\u662fPython 3.9\u800c\u4e0d\u662fplatform-python\uff0c\u56e0\u6b64\u9700\u8981\u5c06\u8fd9\u4e9b\u6587\u4ef6\u590d\u5236\u5230Python 3.9\u7684\u4f4d\u7f6e\u3002<\/p>\n<pre class=\"post-pre\"><code># cp \/usr\/lib64\/python3.6\/site-packages\/{officehelper,uno,unohelper}.py \/usr\/lib64\/python3.9\/site-packages\r\n<\/code><\/pre>\n<h2>\u5b89\u88c5\u6700\u65b0\u7248\u672c\u7684LibreOffice\u5982\u679c\u60a8\u60f3\u4f7f\u7528\u6700\u65b0\u7684LibreOffice\uff08\u76ee\u524d\u7248\u672c\u4e3a7.6.3.2\uff09\uff0c\u8bf7\u5728\u5b98\u65b9\u4e0b\u8f7d\u7f51\u7ad9\u4e0a\u9009\u62e9Linux\uff0864\u4f4d\uff09\uff08rpm\uff09\u4f5c\u4e3a\u64cd\u4f5c\u7cfb\u7edf\u8fdb\u884c\u4e0b\u8f7d\u3002\u65e0\u9700\u989d\u5916\u4e0b\u8f7d\u8bed\u8a00\u76f8\u5173\u7684\u6587\u4ef6\u3002<\/p>\n<p>\u5c06\u5176\u5c55\u5f00\u5e76\u5b89\u88c5RPMS\u76ee\u5f55\u4e2d\u7684rpm\u6587\u4ef6\u3002<\/p>\n<pre class=\"post-pre\"><code># dnf install -y RPMS\/*.rpm\r\n<\/code><\/pre>\n<p>\u6b64\u5916\uff0c\u770b\u8d77\u6765LibreOffice\u7684\u542f\u52a8\u9700\u8981\u4ee5\u4e0b\u5e93\u6587\u4ef6\uff0c\u6240\u4ee5\u5982\u679c\u8fd8\u6ca1\u6709\u7684\u8bdd\uff0c\u5148\u5b89\u88c5\u597d\u3002<\/p>\n<pre class=\"post-pre\"><code># ldd \/opt\/libreoffice7.6\/program\/{oosplash,soffice.bin} | grep 'not found'\r\n\tlibXinerama.so.1 =&gt; not found\r\n\tlibcups.so.2 =&gt; not found\r\n# dnf install -y libXinerama cups-libs\r\n<\/code><\/pre>\n<h1>\u5b57\u4f53\u51c6\u5907<\/p>\n<h2>\u5b89\u88c5\u65e5\u8bed\u5b57\u4f53\u5982\u679c\u5728CentOS 9\u4e0a\u5b89\u88c5\u4e86\u65e5\u8bed\u73af\u5883\uff08langpacks-ja\uff09\u6216\u5b89\u88c5\u4e86libreoffice-langpack-ja\uff0c\u90a3\u4e48Noto\u7cfb\u5217CJK\u5b57\u4f53\u4e5f\u4f1a\u4e00\u5e76\u5b89\u88c5\u3002<\/p>\n<p>\u9664\u6b64\u4e4b\u5916\u7684\u60c5\u51b5\uff0c\u6211\u4eec\u9700\u8981\u660e\u786e\u5730\u6309\u7167\u4ee5\u4e0b\u65b9\u5f0f\u5b89\u88c5\u3002<\/p>\n<pre class=\"post-pre\"><code># dnf install -y google-noto-sans-cjk-ttc-fonts google-noto-serif-cjk-ttc-fonts\r\n<\/code><\/pre>\n<p>\u53e6\u5916\uff0c\u60a8\u4e5f\u53ef\u4ee5\u5f9e\u5b98\u65b9\u767c\u5e03\u7684Google\u7db2\u7ad9\u4e0a\u4e0b\u8f09\u4e26\u5b89\u88ddNoto\u5b57\u9ad4\uff0c\u4f46\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u7531\u65bc\u5176\u65b7\u7232\u4e0d\u540c\u7684\u5b57\u91cd\u8b8a\u5316\uff0c\u6240\u4ee5\u8acb\u5c0f\u5fc3\u3002\u9664\u4e86Noto\u7cfb\u5217\u5b57\u9ad4\u4e4b\u5916\uff0c\u5982\u679c\u6709\u53ef\u80fd\u5728\u539f\u59cb\u6587\u6a94\u4e2d\u4f7f\u7528\u5176\u4ed6\u5b57\u9ad4\uff0c\u5247\u5efa\u8b70\u60a8\u5728\u9700\u8981\u6642\u5c07\u5176\u5b89\u88dd\u5728\/usr\/share\/fonts\u76ee\u9304\u4e0b\u3002BIZ UD\u7cfb\u5217\u548cIPA\u7cfb\u5217\u5b57\u9ad4\u662f\u4ee3\u8868\u6027\u7bc4\u4f8b\u3002<\/p>\n<h2>\u8bbe\u7f6e\u5b57\u4f53\u522b\u540d<br \/>\n\u5728Windows\u548cOffice\u4e2d\u914d\u5907\u7684\u5b57\u4f53\u4e2d\uff0c\u5f88\u591a\u60c5\u51b5\u4e0b\u662f\u65e0\u6cd5\u6839\u636e\u8bb8\u53ef\u8bc1\u8fdb\u884c\u4f7f\u7528\u7684\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u5982\u679c\u6307\u5b9a\u4e86\u60f3\u8981\u4f7f\u7528\u7684\u5b57\u4f53\u4ee5\u53ca\u53ef\u7528\u4f5c\u66ff\u4ee3\u7684\u5b57\u4f53\u5bf9\u5e94\u5173\u7cfb\uff0c\u5c31\u53ef\u4ee5\u5728\u4e0d\u8fc7\u591a\u635f\u5bb3\u539f\u672c\u6c1b\u56f4\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u8f6c\u6362\u3002\u4ee5\u4e0b\u7684fontconfig\u914d\u7f6e\u6587\u4ef6\u662f\u6211\u4e3a\u81ea\u5df1\u7684\u73af\u5883\u4f7f\u7528\u522b\u540d\u5b9e\u73b0\u7684\u4e00\u4e2a\u4f8b\u5b50\u3002\u4e3a\u4e86\u4f7f\u5176\u66f4\u6613\u4e8e\u9605\u8bfb\uff0c\u5e94\u9002\u5f53\u52a0\u5165\u6362\u884c\u7b26\uff0c\u4f46\u7531\u4e8e\u592a\u8fc7\u5197\u957f\uff0c\u6211\u5c06\u6bcf\u4e2a\u5b57\u4f53\u90fd\u5408\u5e76\u4e3a\u4e00\u884c\u3002\u5982\u679c\u6709\u5305\u542b\u82f1\u6587\u5b57\u4f53\u548c\u5176\u4ed6CJK\u5b57\u4f53\u7684\u66f4\u5b8c\u5584\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u6211\u4f1a\u5f88\u60f3\u8981\u83b7\u53d6\u3002<\/p>\n<pre class=\"post-pre\"><code>&lt;?xml version=\"1.0\"?&gt;\r\n&lt;!DOCTYPE fontconfig SYSTEM \"fonts.dtd\"&gt;\r\n&lt;fontconfig&gt;\r\n    &lt;alias&gt;&lt;family&gt;BIZ UDGothic&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;BIZ UD\u30b4\u30b7\u30c3\u30af&lt;\/family&gt; &lt;accept&gt;&lt;family&gt;BIZ UDGothic&lt;\/family&gt;&lt;\/accept&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;BIZ UDMincho&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Serif CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;BIZ UD\u660e\u671d&lt;\/family&gt; &lt;accept&gt;&lt;family&gt;BIZ UDMincho&lt;\/family&gt;&lt;\/accept&gt; &lt;default&gt;&lt;family&gt;Noto Serif CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;BIZ UDMincho Medium&lt;\/family&gt; &lt;accept&gt;&lt;family&gt;BIZ UDMincho&lt;\/family&gt;&lt;\/accept&gt; &lt;default&gt;&lt;family&gt;Noto Serif CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;BIZ UD\u660e\u671d Medium&lt;\/family&gt; &lt;accept&gt;&lt;family&gt;BIZ UDMincho&lt;\/family&gt;&lt;\/accept&gt; &lt;default&gt;&lt;family&gt;Noto Serif CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;BIZ UDPGothic&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;BIZ UDP\u30b4\u30b7\u30c3\u30af&lt;\/family&gt; &lt;accept&gt;&lt;family&gt;BIZ UDPGothic&lt;\/family&gt;&lt;\/accept&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;BIZ UDPMincho&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Serif CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;BIZ UDP\u660e\u671d&lt;\/family&gt; &lt;accept&gt;&lt;family&gt;BIZ UDPMincho&lt;\/family&gt;&lt;\/accept&gt; &lt;default&gt;&lt;family&gt;Noto Serif CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;BIZ UDPMincho Medium&lt;\/family&gt; &lt;accept&gt;&lt;family&gt;BIZ UDPMincho&lt;\/family&gt;&lt;\/accept&gt; &lt;default&gt;&lt;family&gt;Noto Serif CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;BIZ UDP\u660e\u671d Medium&lt;\/family&gt; &lt;accept&gt;&lt;family&gt;BIZ UDPMincho&lt;\/family&gt;&lt;\/accept&gt; &lt;default&gt;&lt;family&gt;Noto Serif CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;MS Gothic&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;\uff2d\uff33 \u30b4\u30b7\u30c3\u30af&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;MS Mincho&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Serif CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;\uff2d\uff33 \u660e\u671d&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Serif CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;MS PGothic&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;\uff2d\uff33 \uff30\u30b4\u30b7\u30c3\u30af&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;MS PMincho&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Serif CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;\uff2d\uff33 \uff30\u660e\u671d&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Serif CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;MS UI Gothic&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;Meiryo UI&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;Meiryo&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;\u30e1\u30a4\u30ea\u30aa&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;UD Digi Kyokasho NK-B&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;UD \u30c7\u30b8\u30bf\u30eb \u6559\u79d1\u66f8\u4f53 NK-B&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;UD Digi Kyokasho NK-R&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;UD \u30c7\u30b8\u30bf\u30eb \u6559\u79d1\u66f8\u4f53 NK-R&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;UD Digi Kyokasho NP-B&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;UD \u30c7\u30b8\u30bf\u30eb \u6559\u79d1\u66f8\u4f53 NP-B&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;UD Digi Kyokasho NP-R&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;UD \u30c7\u30b8\u30bf\u30eb \u6559\u79d1\u66f8\u4f53 NP-R&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;UD Digi Kyokasho N-B&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;UD \u30c7\u30b8\u30bf\u30eb \u6559\u79d1\u66f8\u4f53 N-B&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;UD Digi Kyokasho N-R&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;UD \u30c7\u30b8\u30bf\u30eb \u6559\u79d1\u66f8\u4f53 N-R&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;Yu Gothic UI&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;Yu Gothic UI Light&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;Yu Gothic UI Semibold&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;Yu Gothic UI Semilight&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;Yu Gothic&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP Light&lt;\/family&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;\u6e38\u30b4\u30b7\u30c3\u30af&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP Light&lt;\/family&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;Yu Gothic Light&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP Thin&lt;\/family&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;\u6e38\u30b4\u30b7\u30c3\u30af Light&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP Thin&lt;\/family&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;Yu Gothic Medium&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP Medium&lt;\/family&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;\u6e38\u30b4\u30b7\u30c3\u30af Medium&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Sans CJK JP Medium&lt;\/family&gt;&lt;family&gt;Noto Sans CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;Yu Mincho&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Serif CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;\u6e38\u660e\u671d&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Serif CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;Yu Mincho Demibold&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Serif CJK JP SemiBold&lt;\/family&gt;&lt;family&gt;Noto Serif CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;\u6e38\u660e\u671d Demibold&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Serif CJK JP SemiBold&lt;\/family&gt;&lt;family&gt;Noto Serif CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;Yu Mincho Light&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Serif CJK JP Light&lt;\/family&gt;&lt;family&gt;Noto Serif CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n    &lt;alias&gt;&lt;family&gt;\u6e38\u660e\u671d Light&lt;\/family&gt; &lt;default&gt;&lt;family&gt;Noto Serif CJK JP Light&lt;\/family&gt;&lt;family&gt;Noto Serif CJK JP&lt;\/family&gt;&lt;\/default&gt;&lt;\/alias&gt;\r\n&lt;\/fontconfig&gt;\r\n<\/code><\/pre>\n<h1>\u51c6\u5907\u548c\u542f\u52a8unoserver\u3002<\/p>\n<h2>\u5b89\u88c5Unoserverunoserver\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528pip3\uff08\u5728CentOS 9\u4e0a\u4e5f\u53ef\u4f7f\u7528pip\u547d\u4ee4\uff09\u8fdb\u884c\u5b89\u88c5\u3002\u867d\u7136\u5728root\u7528\u6237\u4e0b\u6267\u884c\u4f1a\u6536\u5230\u8b66\u544a\uff0c\u4f46\u53ef\u6267\u884c\u811a\u672c\u5c06\u5b89\u88c5\u5728\/usr\/local\/bin\u76ee\u5f55\u4e0b\uff0c\u76f8\u5173\u6587\u4ef6\u5c06\u5b89\u88c5\u5728\/usr\/local\/lib\/python3.9\/site-packages\u76ee\u5f55\u4e0b\uff0c\u56e0\u6b64\u51e0\u4e4e\u4e0d\u4f1a\u4e0e\u6807\u51c6\u8f6f\u4ef6\u5305\u53d1\u751f\u51b2\u7a81\u3002<\/p>\n<pre class=\"post-pre\"><code># pip3 install unoserver\r\n<\/code><\/pre>\n<h2>\u7aef\u53e3\u7684\u6253\u5f00\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cUnoserver\u5c06\u57282003\/TCP\u7aef\u53e3\u7b49\u5f85\u6765\u81ea\u5ba2\u6237\u7aef\u7684\u8fde\u63a5\u3002\u7531\u4e8e\u6ca1\u6709\u8eab\u4efd\u9a8c\u8bc1\uff0c\u9632\u706b\u5899\u548c\u76d1\u542c\u5730\u5740\u7684\u6307\u5b9a\u662f\u552f\u4e00\u7684\u58c1\u5792\u3002\u5728\u539f\u59cb\u7684CentOS\u4e2d\uff0c\u9632\u706b\u5899\u5e94\u8be5\u4f1a\u963b\u6b62\u51e0\u4e4e\u6240\u6709\u7aef\u53e3\uff0c\u56e0\u6b64\u9700\u8981\u5c06\u6b64\u7aef\u53e3\u6253\u5f00\u81f3\u5fc5\u8981\u8303\u56f4\u3002\u5982\u679c\u5728NAT\u4e2d\u6216\u8005\u5176\u4ed6\u5730\u65b9\u8981\u5168\u90e8\u6253\u5f00\uff0c\u53ef\u4ee5\u6309\u4ee5\u4e0b\u65b9\u5f0f\u8bbe\u7f6e\u3002\u5982\u679c2003\/TCP\u7aef\u53e3\u88ab\u5176\u4ed6\u670d\u52a1\u5360\u7528\uff0c\u5219\u8bf7\u9009\u62e9\u9002\u5f53\u7684\u7aef\u53e3\u53f7\uff0c\u5e76\u5728unoserver\u548cunoconvert\u542f\u52a8\u65f6\u4f7f\u7528&#8211;port\u9009\u9879\u8fdb\u884c\u6307\u5b9a\u3002<\/p>\n<pre class=\"post-pre\"><code># firewall-cmd --permanent --add-port 2003\/tcp\r\n# firewall-cmd --reload\r\n<\/code><\/pre>\n<p>\u9664\u4e862003\/TCP\u4e4b\u5916\uff0c2002\/TCP\u4e5f\u5728unoserver\u548cLibreOffice\u670d\u52a1\u5668\u4e4b\u95f4\u4f7f\u7528\u3002\u7136\u800c\uff0c\u7531\u4e8e\u8be5\u901a\u4fe1\u4ec5\u9650\u4e8e\u670d\u52a1\u5668\u5185\u90e8\uff0c\u5982\u679c\u6ca1\u6709\u7279\u6b8a\u7684\u539f\u56e0\uff0c\u53ef\u4ee5\u4e0d\u505a\u4efb\u4f55\u5904\u7406\u3002<\/p>\n<h2>\u542f\u52a8unoserver\u4e3a\u4e86\u5c06\u5176\u4f5c\u4e3asystemd\u670d\u52a1\u6ce8\u518c\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u914d\u7f6e\u6587\u4ef6\u3002\u8be5\u914d\u7f6e\u6587\u4ef6\u88ab\u547d\u540d\u4e3a\/usr\/lib\/systemd\/system\/unoserver.service\uff0c\u4f46\u5982\u679c\u60a8\u662f\u72ec\u7279\u7684\u670d\u52a1\uff0c\u6839\u636e\u60ef\u4f8b\uff0c\u8bf7\u5c06\u5176\u653e\u7f6e\u5728\/etc\/systemd\/system\u4e2d\u3002<\/p>\n<pre class=\"post-pre\"><code>[Unit]\r\nDescription=Unoserver for document conversions\r\nDocumentation=https:\/\/github.com\/unoconv\/unoserver\r\nAfter=network.target\r\n\r\n[Service]\r\nType=simple\r\nEnvironment=\"LC_ALL=ja_JP.UTF-8\"\r\nExecStart=\/usr\/local\/bin\/unoserver --interface 0.0.0.0 --uno-interface 127.0.0.1\r\nTimeoutStopSec=3\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n<\/code><\/pre>\n<p>\u5728\u8bbe\u7f6e\u6587\u4ef6\u4e2d\uff0c\u6211\u4eec\u5e0c\u671b\u5c06\u5176\u4f5c\u4e3a\u5916\u90e8\u670d\u52a1\u63d0\u4f9b\uff0c\u56e0\u6b64\u4f7f\u7528&#8211;interface\u9009\u9879\u6307\u5b9a\u4e3a0.0.0.0\uff0c\u4f46\u5982\u679c\u8981\u5c06IP\u5730\u5740\u9650\u5236\u4e3a\u591a\u4e2a\u4e2d\u7684\u4efb\u4f55\u4e00\u4e2a\uff0c\u6211\u4eec\u9700\u8981\u8fdb\u884c\u6307\u5b9a\uff08\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u53ef\u80fd\u6700\u597d\u4f7f\u7528After=network-online.target\u800c\u4e0d\u662fAfter=network.target\uff09\u3002\u9ed8\u8ba4\u503c\u662f127.0.0.1\u3002&#8211;uno-interface\u662f\u7528\u4e8eunoserver\u548cLibreOffice\u8fde\u63a5\u7684\u63a5\u53e3\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f127.0.0.1\uff0c\u56e0\u6b64\u53ef\u4ee5\u7701\u7565\uff0c\u4f46\u7531\u4e8e\u5b58\u5728\u4e00\u4e2a\u4f3c\u4e4e\u662f\u5df2\u62a5\u544a\u7684\u9519\u8bef\uff08Bug\uff09\u5bfc\u81f4\u9ed8\u8ba4\u503c\u53d8\u4e3a\u4e86\u901a\u8fc7&#8211;interface\u6307\u5b9a\u7684\u503c\uff08\u56e0\u6b64\u6211\u4eec\u8981\u8fdb\u884c\u660e\u786e\u6307\u5b9a\uff09\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u73af\u5883\u53d8\u91cfLC_ALL\u6765\u8bbe\u7f6e\u5728\u6ca1\u6709\u5305\u542b\u8bed\u8a00\u6216\u5b57\u7b26\u7f16\u7801\u4fe1\u606f\u7684\u8f93\u5165\u4e2d\uff0c\u7528\u4e8e\u9009\u62e9\u5b57\u4f53\u6240\u9700\u7684\u9ed8\u8ba4\u8bbe\u7f6e\u3002\u5982\u679c\u60a8\u5728\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u5df2\u7ecf\u9009\u62e9\u4e86\u65e5\u6587\u8bbe\u7f6e\uff0c\u5219\u53ef\u80fd\u4e0d\u9700\u8981\u8fd9\u4e2a\u8bbe\u7f6e\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u7531\u4e8e\u5728CentOS 9\u4e2d\u505c\u6b62\u670d\u52a1\u65f6\u53ef\u80fd\u4f1a\u51fa\u73b0\u95ee\u9898\uff0c\u6240\u4ee5\u6211\u628aTimeoutStopSec\u4ece\u9ed8\u8ba4\u768490\u79d2\u6539\u4e3a3\u79d2\u3002<\/p>\n<p>\u5982\u679c\u5b89\u88c5\u4e86\u6700\u65b0\u7248\u672c\u7684\u516c\u5f0f\u7248LibreOffice\uff0c\u5219\u9700\u8981\u8fdb\u884c\u4ee5\u4e0b\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\uff1apyuno\u76f8\u5173\u6587\u4ef6\u6240\u5728\u76ee\u5f55\u7684\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u3001Uno Runtime\u73af\u5883\u7684\u914d\u7f6e\u6587\u4ef6\u7684\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u3001LibreOffice\u7684\u6267\u884c\u547d\u4ee4\u540d\u79f0\u7684\u9009\u9879\u6307\u5b9a\u3002\u5373\u5982\u4e0b\u6240\u793a\u3002<\/p>\n<pre class=\"post-pre\"><code>[Unit]\r\nDescription=Unoserver for document conversions\r\nDocumentation=https:\/\/github.com\/unoconv\/unoserver\r\nAfter=network.target\r\n\r\n[Service]\r\nType=simple\r\nEnvironment=\"LC_ALL=ja_JP.UTF-8\"\r\nEnvironment=\"PYTHONPATH=\/opt\/libreoffice7.6\/program\"\r\nEnvironment=\"URE_BOOTSTRAP=vnd.sun.star.pathname:\/opt\/libreoffice7.6\/program\/fundamentalrc\"\r\nExecStart=\/usr\/local\/bin\/unoserver --executable libreoffice7.6 --interface 0.0.0.0 --uno-interface 127.0.0.1\r\nTimeoutStopSec=3\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n<\/code><\/pre>\n<p>\u6211\u5011\u5c07\u555f\u7528\u4e26\u555f\u52d5 systemctl \u670d\u52d9\u3002<\/p>\n<pre class=\"post-pre\"><code># systemctl enable unoserver\r\n# systemctl start unoserver\r\n<\/code><\/pre>\n<h1>\u5ba2\u6237\u51c6\u5907\u548c\u6267\u884c\u5ba2\u6237\u7aef\u4e0d\u9700\u8981\u4e0e\u670d\u52a1\u5668\u5728\u540c\u4e00\u53f0\u673a\u5668\u6216\u64cd\u4f5c\u7cfb\u7edf\u4e0a\uff0c\u56e0\u4e3a\u53ef\u80fd\u5b58\u5728\u5404\u79cd\u60c5\u51b5\uff0c\u4e0d\u4e00\u4e00\u8be6\u8ff0\u3002\u4f46\u5982\u679c\u5728CentOS\u6216Ubuntu\u4e0a\u5b89\u88c5\u4e86\u9002\u5f53\u7248\u672c\u7684Python 3\u548cpip\uff0c\u5e76\u63d0\u4f9b\u7ed9\u6240\u6709\u7528\u6237\uff0c\u90a3\u4e48\u8bf7\u5b89\u88c5unoserver\uff0c\u4e0e\u670d\u52a1\u5668\u7aef\u4e00\u6837\u3002<\/p>\n<pre class=\"post-pre\"><code># pip3 install unoserver\r\n<\/code><\/pre>\n<p>\u53ea\u9700\u4e00\u79cd\u9009\u9879\uff0c\u4ee5\u4e0b\u662f\u5bf9\u8be5\u53e5\u7684\u4e2d\u6587\u672c\u5730\u5316\u6539\u5199\uff1a\u201c\u5fc5\u8981\u7684\u662f\u5c06\/usr\/local\/bin\/unoconvert\uff08\u6839\u636e\u9700\u8981\u4e5f\u53ef\u4ee5\u5305\u62ecunocompare\uff09\u590d\u5236\u6216\u94fe\u63a5\u5230\/usr\/bin\uff0c\u6216\u8005\u5728\/usr\/local\/bin\u4e2d\u8bbe\u7f6ePATH\uff0c\u6216\u8005\u901a\u8fc7\u6307\u5b9a\u5b8c\u6574\u8def\u5f84\u6765\u6267\u884c\u3002\u201d<\/p>\n<p>\u6267\u884c\u8f6c\u6362\u7684\u65b9\u6cd5\u5982\u4e0b\u3002<\/p>\n<pre class=\"post-pre\"><code>$ unoconvert --host SERVERIPADDRORNAME sample.docx sample.pdf\r\n<\/code><\/pre>\n<p>\u5728\u6d4b\u8bd5\u76ee\u7684\u6216\u5176\u4ed6\u60c5\u51b5\u4e0b\uff0c\u5982\u679c\u8981\u5728VirtualBox\u7b49\u865a\u62df\u673a\u7684guest machine\u4e0a\u542f\u52a8unoserver\uff0c\u5e76\u901a\u8fc7NAT+\u7aef\u53e3\u8f6c\u53d1\u4ecehost machine\u8fdb\u884c\u8fde\u63a5\uff0c\u6709\u4e00\u70b9\u9700\u8981\u6ce8\u610f\u3002\u5f53\u4f7f\u7528&#8211;host 127.0.0.1\u53c2\u6570\uff08\u6216\u8005\u7701\u7565\u8be5\u53c2\u6570\uff09\u65f6\uff0c\u5373\u4f7f\u6307\u5b9a&#8211;host-location remote\uff0c\u8f93\u51fa\u6587\u4ef6\u4ecd\u4f1a\u5728\u670d\u52a1\u5668\u7aef\u521b\u5efa\uff0c\u8fd9\u662f\u4e00\u4e2a\u5df2\u62a5\u544a\u7684bug\u3002\u53ea\u6709\u5f53&#8211;host\u8bbe\u7f6e\u4e3a\u9ed8\u8ba4\u7684127.0.0.1\u548clocalhost\u65f6\uff0c\u5b83\u624d\u4f1a\u88ab\u7279\u522b\u5904\u7406\uff0c\u56e0\u6b64\u4ecd\u7136\u53ef\u4ee5\u901a\u8fc7\u6307\u5b9a127.1\u7b49\u6765\u7ed5\u8fc7\u6b64\u95ee\u9898\u3002<\/p>\n<h1>\u6700\u540e\u6211\u89e3\u91ca\u4e86\u5728\u5b89\u88c5CentOS\u65f6\u6240\u9700\u8fdb\u884c\u7684\u5404\u79cd\u51c6\u5907\u5de5\u4f5c\u548c\u6ce8\u610f\u4e8b\u9879\u3002\u5c3d\u7ba1\u8fd9\u662f\u4e00\u4e2a\u5c0f\u5de5\u5177\uff0c\u4f46\u7531\u4e8e\u64cd\u4f5c\u7cfb\u7edf\u7684\u5dee\u5f02\u3001Python\u7684\u5dee\u5f02\u3001LibreOffice\u7684\u5dee\u5f02\u7b49\uff0c\u5b58\u5728\u8bb8\u591a\u5bb9\u6613\u51fa\u9519\u7684\u5730\u65b9\uff0c\u5982\u679c\u4e0d\u4e00\u4e00\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\u5c31\u65e0\u6cd5\u6210\u529f\u5b89\u88c5\u3002\u5e0c\u671b\u6211\u6240\u63d0\u4f9b\u7684\u5e2e\u52a9\u5bf9\u4e8e\u90a3\u4e9b\u65e0\u6cd5\u4eab\u53d7\u8fd9\u6837\u7684\u5c1d\u8bd5\u548c\u9519\u8bef\u3001\u6216\u8005\u6ca1\u6709\u592a\u591a\u65f6\u95f4\u6295\u5165\u7684\u8bfb\u8005\u6765\u8bf4\u662f\u6709\u76ca\u7684\u3002<\/p>\n<p>\u5f53\u9700\u8981\u660e\u786e\u9664\u9ed8\u8ba4\u8bed\u8a00\u548c\u7f16\u7801\u4ee5\u5916\u7684\u6587\u672c\u6216CSV\u6587\u4ef6\u65f6\uff0c\u6211\u5bf9\u9002\u5f53\u7684\u8fc7\u6ee4\u5668\u6307\u5b9a\u65b9\u6cd5\u5e76\u4e0d\u5341\u5206\u6e05\u695a\u3002<\/p>\n<p>\u5e0c\u671b\u64cd\u4f5c\u7cfb\u7edf\u7684\u5b89\u88c5\u8fc7\u7a0b\u66f4\u52a0\u7b80\u4fbf\uff0c\u540c\u65f6\u5e0c\u671b\u5728OS\u7684\u652f\u6301\u548c\u672a\u6765\u7248\u672c\u66f4\u65b0\u4e2d\u89e3\u51b3\u529f\u80fd\u548c\u6587\u6863\u4e0d\u8db3\u7684\u95ee\u9898\u3002<\/p>\n<p>\u5982\u679c\u60a8\u5728\u5b89\u88c5\u65f6\u9047\u5230\u4e86\u95ee\u9898\uff0c\u8bf7\u5728\u8bc4\u8bba\u4e2d\u544a\u8bc9\u6211\u4eec\u3002<\/p>\n<p>\u795d\u4f60\u6109\u5feb\u7684\u8f6c\u6362\u751f\u6d3b\uff01<\/p>\n<section>\u4ee5\u4e0b\u662fLibreOffice 6.4\u51fa\u73b0\u6545\u969c\u7684\u6587\u4ef6\u793a\u4f8b\uff1a\u5c06HEIC\u6587\u4ef6\u7684\u6269\u5c55\u540d\u66f4\u6539\u4e3aJPG\u7684\u60c5\u51b5\uff0c\u90e8\u5206\uff08\u53ef\u80fd\u662f\u56e0\u4e3a\u63d2\u5165\u7684\u56fe\u50cf\u7b49\u539f\u56e0\u5bfc\u81f4\u5e03\u5c40\u5927\u5e45\u53d8\u5316\u7684\uff09Word\u6587\u4ef6\u3002<\/section>\n","protected":false},"excerpt":{"rendered":"<p>\u9019\u662f2023\u5e74LibreOffice\u79d1\u6280\u964d\u4e16\u7d00\u66c6\u7684\u7b2c\u4e03\u7bc7\u6587\u7ae0\u3002 \u4e00\u500bunoserver\u662f\u6307LibreOffic [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[227],"class_list":["post-28344","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-227"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5728CentOS\u670d\u52a1\u5668\u4e0a\u5b89\u88c5unoserver - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"\u5173\u4e8e\u5728CentOS\u670d\u52a1\u5668\u4e0a\u5b89\u88c5unoserver\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5728centos\u670d\u52a1\u5668\u4e0a\u5b89\u88c5unoserver\u3002-2\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5728CentOS\u670d\u52a1\u5668\u4e0a\u5b89\u88c5unoserver\" \/>\n<meta property=\"og:description\" content=\"\u5173\u4e8e\u5728CentOS\u670d\u52a1\u5668\u4e0a\u5b89\u88c5unoserver\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u5728centos\u670d\u52a1\u5668\u4e0a\u5b89\u88c5unoserver\u3002-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-21T08:35:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-11T23:41:13+00:00\" \/>\n<meta name=\"author\" content=\"\u9038, \u79d1\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u9038, \u79d1\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e5%ae%89%e8%a3%85unoserver%e3%80%82-2\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e5%ae%89%e8%a3%85unoserver%e3%80%82-2\/\",\"name\":\"\u5728CentOS\u670d\u52a1\u5668\u4e0a\u5b89\u88c5unoserver - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-01-21T08:35:56+00:00\",\"dateModified\":\"2025-08-11T23:41:13+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/85c1dae56e6ea1e695c73d33c684d487\"},\"description\":\"\u5173\u4e8e\u5728CentOS\u670d\u52a1\u5668\u4e0a\u5b89\u88c5unoserver\u7684\u6280\u672f\u6587\u7ae0\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e5%ae%89%e8%a3%85unoserver%e3%80%82-2\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e5%ae%89%e8%a3%85unoserver%e3%80%82-2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e5%ae%89%e8%a3%85unoserver%e3%80%82-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5728CentOS\u670d\u52a1\u5668\u4e0a\u5b89\u88c5unoserver\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/85c1dae56e6ea1e695c73d33c684d487\",\"name\":\"\u9038, \u79d1\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c94f6d9cbbfbca863fab309840bd690c153c95f8490c290ad2ed54dd693dad16?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c94f6d9cbbfbca863fab309840bd690c153c95f8490c290ad2ed54dd693dad16?s=96&d=mm&r=g\",\"caption\":\"\u9038, \u79d1\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/keyi\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e5%ae%89%e8%a3%85unoserver%e3%80%82-2\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u5728CentOS\u670d\u52a1\u5668\u4e0a\u5b89\u88c5unoserver - Blog - Silicon Cloud","description":"\u5173\u4e8e\u5728CentOS\u670d\u52a1\u5668\u4e0a\u5b89\u88c5unoserver\u7684\u6280\u672f\u6587\u7ae0","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u5728centos\u670d\u52a1\u5668\u4e0a\u5b89\u88c5unoserver\u3002-2\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5728CentOS\u670d\u52a1\u5668\u4e0a\u5b89\u88c5unoserver","og_description":"\u5173\u4e8e\u5728CentOS\u670d\u52a1\u5668\u4e0a\u5b89\u88c5unoserver\u7684\u6280\u672f\u6587\u7ae0","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u5728centos\u670d\u52a1\u5668\u4e0a\u5b89\u88c5unoserver\u3002-2\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-01-21T08:35:56+00:00","article_modified_time":"2025-08-11T23:41:13+00:00","author":"\u9038, \u79d1","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u9038, \u79d1","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e5%ae%89%e8%a3%85unoserver%e3%80%82-2\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e5%ae%89%e8%a3%85unoserver%e3%80%82-2\/","name":"\u5728CentOS\u670d\u52a1\u5668\u4e0a\u5b89\u88c5unoserver - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-01-21T08:35:56+00:00","dateModified":"2025-08-11T23:41:13+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/85c1dae56e6ea1e695c73d33c684d487"},"description":"\u5173\u4e8e\u5728CentOS\u670d\u52a1\u5668\u4e0a\u5b89\u88c5unoserver\u7684\u6280\u672f\u6587\u7ae0","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e5%ae%89%e8%a3%85unoserver%e3%80%82-2\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e5%ae%89%e8%a3%85unoserver%e3%80%82-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e5%ae%89%e8%a3%85unoserver%e3%80%82-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u5728CentOS\u670d\u52a1\u5668\u4e0a\u5b89\u88c5unoserver"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/85c1dae56e6ea1e695c73d33c684d487","name":"\u9038, \u79d1","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c94f6d9cbbfbca863fab309840bd690c153c95f8490c290ad2ed54dd693dad16?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c94f6d9cbbfbca863fab309840bd690c153c95f8490c290ad2ed54dd693dad16?s=96&d=mm&r=g","caption":"\u9038, \u79d1"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/keyi\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e5%9c%a8centos%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e5%ae%89%e8%a3%85unoserver%e3%80%82-2\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/28344","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=28344"}],"version-history":[{"count":3,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/28344\/revisions"}],"predecessor-version":[{"id":111317,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/28344\/revisions\/111317"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=28344"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=28344"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=28344"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}