linux安装office办公套件[L]

  1. 一 libreoffice
  2. 二 WPS
  3. 三 安装原版office365(未测试)

一 libreoffice

apt直接安装

sudo apt update
sudo apt install libreoffice libreoffice-l10n-zh-tw

link_to_page

linux中libreoffice最小化安装|中文语言包设置

二 WPS

https://linux.wps.cn/下载deb安装包

终端使用

dpkg -i 安装包.deb

三 安装原版office365(未测试)

Office 365我是用教育版,登入学校帐号就会自动启用授权。 下载的版本为Microsoft Office 365 (2002. 组建12527.22286)


实际测试Word可以执行


![XT0PRoT.png](https://i.imgur.com/XT0PRoT.png)


Excel正常执行


![fUhxIbg.png](https://i.imgur.com/fUhxIbg.png)


PowerPoint开旧档则是会随机闪退。


![MrOa4wW.png](https://i.imgur.com/MrOa4wW.png)


Access、Outlook、OneNote、Publisher没详细测试。 另外OneDrive的功能怪怪的,所以只能编辑本地档案。


根据Github和Reddit用户的回报,Arch、Ubuntu、openSUSE、Fedora都可以用此方式安装Microsoft Office 365,但无法收到自动更新。 也请注意此软件没有任何保证,档案毁损恕不负责。


整体来说我觉得还是不够稳定,如果还是想试试,请参考以下步骤。


## [1. 安装前置依赖套件](https://ivonblog.com/posts/linux-wine-microsoft-office-365/#contents:1-%E5%AE%89%E8%A3%9D%E5%89%8D%E7%BD%AE%E4%BE%9D%E8%B3%B4%E5%A5%97%E4%BB%B6)

1. 于Linux系统安装[Docker](https://ivonblog.com/posts/install-docker-engine-on-linux/)
2. 安装[PlayOnLinux](https://www.playonlinux.com/en/download.html),开启一次后将其关闭。

## [2. 编译Crossover Wine](https://ivonblog.com/posts/linux-wine-microsoft-office-365/#contents:2-%E7%B7%A8%E8%AD%AFcrossover-wine)

1. 建立32位的Debian环境,之后会印出建置好的映像档ID

| `mkdir winebuild`
_`cd`_ `winebuild
wget -O Dockerfile https://raw.githubusercontent.com/PhoenicisOrg/phoenicis-winebuild/master/environments/linux-x86-wine
sudo docker build .` |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

1. 接近集装箱终端机

| `1` | `sudo docker run -it -v` **`$(`**`realpath ./build`**`)`**`:/mnt/build --name winebuild "映像檔ID"` |
| --- | ------------------------------------------------------------------------------------------------ |

1. 编译Crossover Wine 21.2.0

| _`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` |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

1. 取出编译好的Wine,放到PlayOnLinux的目录

| `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. 清理用不到的档案

| `sudo rm -rf build
sudo docker ps --all`
_`# 刪除不要的Docker映像檔`_
`sudo docker rm -v "映像檔ID"
sudo docker rmi "映像檔ID"`
_`cd`_ `..
sudo rm -rf winebuild` |
| --------------------------------------------------------------------------------------------------------------------------------------------------- |


## [3. 安装Windows字体](https://ivonblog.com/posts/linux-wine-microsoft-office-365/#contents:3-%E5%AE%89%E8%A3%9Dwindows%E5%AD%97%E5%9E%8B)

1. 从[微软官网](http://care.dlservice.microsoft.com/dl/download/B/9/9/B999286E-0A47-406D-8B3D-5B5AD7373A4A/9600.17050.WINBLUE_REFRESH.140317-1640_X86FRE_ENTERPRISE_EVAL_EN-US-IR3_CENA_X86FREE_EN-US_DV9.ISO)下载32位的Windows 8.1 Enterprise Evaluation ISO。
2. 解出字体文件夹

| `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. 删除不必要的档案

| `1
2` | `rm -rf sources
rm -f Windows/Fonts/*.fon Windows/Fonts/*.ini Windows/Fonts/*.dat Windows/Fonts/*.xml` |
| ----- | ------------------------------------------------------------------------------------------------------ |

1. 将Windows字体复制至Linux的字体目录

| `1
2` | `sudo cp -r Windows/Fonts /usr/share/fonts/msfonts
fc-cache -f -v` |
| ----- | ------------------------------------------------------------------ |


## [4. 下载Office 365安装文件](https://ivonblog.com/posts/linux-wine-microsoft-office-365/#contents:4-%E4%B8%8B%E8%BC%89office-365%E5%AE%89%E8%A3%9D%E6%AA%94)

1. 安装[User-Agent Switcher and Manager](https://chrome.google.com/webstore/detail/user-agent-switcher-and-m/bhchdcejhohfmigjafbampogmaanbfkg)扩充功能,点击右上角,将浏览器伪装成Windows的Chrome,再点选。 `Apply (all windows)`

    ![4FFSwzQ.png](https://i.imgur.com/4FFSwzQ.png)

2. 到[Office365官网](https://portal.office.com/account/?ref=MeControl),登入帐号,进入Office安装文件下载页面,选取32位版,会得到。 `OfficeSetup.exe`

    ![vT02ceO.png](https://i.imgur.com/vT02ceO.png)


## [5. 开始安装Office365](https://ivonblog.com/posts/linux-wine-microsoft-office-365/#contents:5-%E9%96%8B%E5%A7%8B%E5%AE%89%E8%A3%9Doffice365)

1. 下载安装脚本

| `1` | `wget https://raw.githubusercontent.com/DonutsBl/office365-pol/main/office365-pol.sh` |
| --- | ------------------------------------------------------------------------------------- |

1. 开启PlayOnLinux,点击工具→执行一个本地脚本

    ![TNEVXBr.png](https://i.imgur.com/TNEVXBr.png)

2. 选取安装脚本,点击我同意

    ![AwKL5wK.png](https://i.imgur.com/AwKL5wK.png)

3. 选取安装文件`OfficeSetup.exe`

    ![EXa3mWr.png](https://i.imgur.com/EXa3mWr.png)

4. 按照指示将Wine版本切换为Windows 7。

    ![1PQd7vn.png](https://i.imgur.com/1PQd7vn.png)

5. 等待Office安装完成。

    ![uU5myuF.png](https://i.imgur.com/uU5myuF.png)

6. 尽管看不到进度条,工作管理员还是可以看到Office在下载东西。

    ![6LbNy9n.png](https://i.imgur.com/6LbNy9n.png)

7. 安装完成后Office图标即会出现在桌面

    ![imieQcA.png](https://i.imgur.com/imieQcA.png)

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

    ![C2HQE3N.png](https://i.imgur.com/C2HQE3N.png)


直接登入Microsoft账号启用教育版授权,对话框可能会消失,建议先登入个人Microsoft帐号再登入学校给的Microsoft账号。

欢迎指出任何有错误或不够清晰的表达,可以在下面评论区评论。

×

喜欢就点赞,疼爱就打赏

//