在CentOS上配置LibOffice的步驟如下:
更新系統:
sudo yum update -y
安裝開發工具和依賴庫:
sudo yum groupinstall -y "Development Tools"
sudo yum install -y wget libX11-devel libXext-devel libXrender-devel libjpeg-turbo-devel libpng-devel libtiff-devel libopenjp2-devel libfontconfig-devel
下載并安裝LibOffice:
wget https://download.libreoffice.org/libreoffice/stable/libreoffice-7.0.6.tar.gz
tar -xzf libreoffice-7.0.6.tar.gz
cd libreoffice-7.0.6
sudo ./configure --prefix=/usr
sudo make -j$(nproc)
sudo make install
創建配置文件目錄(如果不存在):
sudo mkdir -p ~/.config/libreoffice
復制示例配置文件:
sudo cp -r /usr/share/doc/libreoffice/examples/user/config ~/.config/libreoffice/
設置環境變量(可選):
編輯~/.bashrc
或~/.zshrc
文件,添加以下內容:
export PATH=$PATH:/usr/local/bin
然后運行:
source ~/.bashrc
啟動LibreOffice:
soffice
檢查版本: 在LibreOffice的菜單欄中選擇“幫助” > “關于LibreOffice”,你應該能看到安裝的版本信息。
以上步驟應該可以幫助你在CentOS上成功安裝和配置LibOffice。如果在操作過程中遇到任何問題,建議查閱LibreOffice的官方文檔或尋求社區支持。