儘管Linux有開源的LibreOffice,偶爾還是會想試試看能不能於本機裝Microsoft Office 365玩玩。
Microsoft Office是著名的專有軟體,在LibreOffice越來越多人採用,且微軟也推出網頁版Office的現在,究竟有無必要在Linux裝桌面版Office?就個人經驗而言,微軟的網頁版Office頂多就是確保文件開啟排版不會亂掉,某些功能還是得用到桌面版Office。
搜尋後發現Crossover (付費版的Wine) 有提供Office365的支援,花錢買他們的產品即可了事。
如果要免費使用,只要自行編譯Crossover修改過的Wine,再配合Github的DonutsBl/office365-pol指令稿,就可以於Linux安裝32位元的Office。
Office 365我是用教育版,登入學校帳號就會自動啟用授權。下載的版本為Microsoft Office 365 (2002. 組建12527.22286)
實際測試Word可以執行

Excel正常執行

PowerPoint開舊檔則是會隨機閃退。

Access、Outlook、OneNote、Publisher沒詳細測試。另外OneDrive的功能怪怪的,所以只能編輯本機檔案。
根據Github和Reddit用戶的回報,Arch、Ubuntu、openSUSE、Fedora都可以用此方式安裝Microsoft Office 365,但無法收到自動更新。也請注意此軟體沒有任何保證,檔案毀損恕不負責。
整體來說我覺得還是不夠穩定,如果還是想試試,請參考以下步驟。
於Linux系統安裝Docker
安裝PlayOnLinux,開啟一次後將其關閉。
- 建立32位元的Debian環境,之後會印出建置好的映像檔ID
1
2
3
4
| mkdir winebuild
cd winebuild
wget -O Dockerfile https://raw.githubusercontent.com/PhoenicisOrg/phoenicis-winebuild/master/environments/linux-x86-wine
sudo docker build .
|
- 進入容器終端機
1
| sudo docker run -it -v $(realpath ./build):/mnt/build --name winebuild "映像檔ID"
|
- 編譯Crossover Wine 21.2.0
1
2
3
4
5
6
7
8
| cd /mnt/build
wget https://media.codeweavers.com/pub/crossover/source/crossover-sources-21.2.0.tar.gz
tar -xzf crossover-sources-21.2.0.tar.gz sources/wine
cd sources/wine
echo '#define WINDEBUG_WHAT_HAPPENED_MESSAGE "This can be caused by a problem in the program or a deficiency in Wine."' >> include/distversion.h
echo '#define WINDEBUG_USER_SUGGESTION_MESSAGE "If this problem is not present under Windows and has not been reported yet, you can save the detailed information to a file using the \"Save As\" button, then file a bug report and attach that file to the report."' >> include/distversion.h
./configure --disable-winedbg --disable-mscms --without-vulkan
make -j8
|
- 取出編譯好的Wine,放到PlayOnLinux的目錄
1
2
3
4
5
6
7
8
| make install
mkdir /mnt/build/cx-21.2.0
cp -R /usr/local/bin /mnt/build/sources/wine/include /mnt/build/cx-21.2.0
mkdir /mnt/build/cx-21.2.0/lib
cp -R /usr/local/lib/wine /usr/local/lib/libwine* /mnt/build/cx-21.2.0/lib
mkdir /mnt/build/cx-21.2.0/share
cp -R /usr/local/share/man /usr/local/share/wine /mnt/build/cx-21.2.0/share
cp -R build/cx-21.2.0 ~/.PlayOnLinux/wine/linux-x86
|
- 清理用不到的檔案
1
2
3
4
5
6
7
| sudo rm -rf build
sudo docker ps --all
# 刪除不要的Docker映像檔
sudo docker rm -v "映像檔ID"
sudo docker rmi "映像檔ID"
cd ..
sudo rm -rf winebuild
|
從微軟官網下載32位元的Windows 8.1 Enterprise Evaluation ISO。
解出字型資料夾
1
2
| 7z x B999286E-0A47-406D-8B3D-5B5AD7373A4A/9600.17050.WINBLUE_REFRESH.140317-1640_X86FRE_ENTERPRISE_EVAL_EN-US-IR3_CENA_X86FREE_EN-US_DV9.ISO
7z x sources/install.wim Windows/Fonts
|
- 刪除不必要的檔案
1
2
| rm -rf sources
rm -f Windows/Fonts/*.fon Windows/Fonts/*.ini Windows/Fonts/*.dat Windows/Fonts/*.xml
|
- 將Windows字型複製至Linux的字型目錄
1
2
| sudo cp -r Windows/Fonts /usr/share/fonts/msfonts
fc-cache -f -v
|
安裝User-Agent Switcher and Manager擴充功能,點選右上角,將瀏覽器偽裝成Windows的Chrome,再點選Apply (all windows)
。

到Office365官網,登入帳號,進入Office安裝檔下載頁面,選取32位元版,會得到OfficeSetup.exe
。

- 下載安裝指令稿
1
| wget https://raw.githubusercontent.com/DonutsBl/office365-pol/main/office365-pol.sh
|
開啟PlayOnLinux,點選工具→執行一個本地腳本

選取安裝指令稿,點選我同意

選取安裝檔OfficeSetup.exe

按照指示將Wine版本切換為Windows 7。

等待Office安裝完成。

儘管看不到進度條,工作管理員還是可以看到Office在下載東西。

安裝完成後Office圖示即會出現在桌面

也可以在應用程式列表找到Office。

直接登入Microsoft帳號啟用教育版授權,對話框可能會消失,建議先登入個人Microsoft帳號再登入學校給的Microsoft帳號。