Ubuntu手動升級Libreoffice

每一個打工仔,電腦上都要裝上一個辦公套件,除了常見的WPS Office、Microsoft Office外,對Linux用戶來說Libreoffice也是個不錯的選擇,通常系統默認的Libreoffice版本都落後官方,想體驗新功能則需要自己動手,去官網下載最新安裝包升級,下面以deb係爲例,演示升級過程。

1. 下載最新deb安裝包

官網下載後的deb包, 形如 LibreOffice_$version_Linux_x86-deb.tar.gz

1➜  soft ls -al LibreOffice_7.5.0_Linux_x86-64_deb.tar.gz
2-rw-rw-r-- 1 mephisto mephisto 198614921 Feb  3 14:42 LibreOffice_7.5.0_Linux_x86-64_deb.tar.gz

2. 解壓、安裝

解壓後,切換到DEBS目錄,然後 sudo dpkg -i *.deb 安裝即可,有耐心的可以先讀下readmes文件。

 1➜  tar -xvf LibreOffice_7.5.0_Linux_x86-64_deb.tar.gz
 2➜  soft cd LibreOffice_7.5.0.3_Linux_x86-64_deb
 3➜  LibreOffice_7.5.0.3_Linux_x86-64_deb ls
 4DEBS  readmes
 5➜  LibreOffice_7.5.0.3_Linux_x86-64_deb cd DEBS
 6➜  DEBS ls
 7libobasis7.5-base_7.5.0.3-3_amd64.deb                                  libobasis7.5-images_7.5.0.3-3_amd64.deb                  libobasis7.5-xsltfilter_7.5.0.3-3_amd64.deb
 8libobasis7.5-calc_7.5.0.3-3_amd64.deb                                  libobasis7.5-impress_7.5.0.3-3_amd64.deb                 libreoffice7.5_7.5.0.3-3_amd64.deb
 9libobasis7.5-core_7.5.0.3-3_amd64.deb                                  libobasis7.5-kde-integration_7.5.0.3-3_amd64.deb         libreoffice7.5-base_7.5.0.3-3_amd64.deb
10libobasis7.5-draw_7.5.0.3-3_amd64.deb                                  libobasis7.5-librelogo_7.5.0.3-3_amd64.deb               libreoffice7.5-calc_7.5.0.3-3_amd64.deb
11libobasis7.5-en-us_7.5.0.3-3_amd64.deb                                 libobasis7.5-libreofficekit-data_7.5.0.3-3_amd64.deb     libreoffice7.5-debian-menus_7.5.0-3_all.deb
12libobasis7.5-extension-beanshell-script-provider_7.5.0.3-3_amd64.deb   libobasis7.5-math_7.5.0.3-3_amd64.deb                    libreoffice7.5-dict-en_7.5.0.3-3_amd64.deb
13libobasis7.5-extension-javascript-script-provider_7.5.0.3-3_amd64.deb  libobasis7.5-ogltrans_7.5.0.3-3_amd64.deb                libreoffice7.5-dict-es_7.5.0.3-3_amd64.deb
14libobasis7.5-extension-mediawiki-publisher_7.5.0.3-3_amd64.deb         libobasis7.5-onlineupdate_7.5.0.3-3_amd64.deb            libreoffice7.5-dict-fr_7.5.0.3-3_amd64.deb
15libobasis7.5-extension-nlpsolver_7.5.0.3-3_amd64.deb                   libobasis7.5-ooofonts_7.5.0.3-3_amd64.deb                libreoffice7.5-draw_7.5.0.3-3_amd64.deb
16libobasis7.5-extension-pdf-import_7.5.0.3-3_amd64.deb                  libobasis7.5-ooolinguistic_7.5.0.3-3_amd64.deb           libreoffice7.5-en-us_7.5.0.3-3_amd64.deb
17libobasis7.5-extension-report-builder_7.5.0.3-3_amd64.deb              libobasis7.5-postgresql-sdbc_7.5.0.3-3_amd64.deb         libreoffice7.5-impress_7.5.0.3-3_amd64.deb
18libobasis7.5-firebird_7.5.0.3-3_amd64.deb                              libobasis7.5-python-script-provider_7.5.0.3-3_amd64.deb  libreoffice7.5-math_7.5.0.3-3_amd64.deb
19libobasis7.5-gnome-integration_7.5.0.3-3_amd64.deb                     libobasis7.5-pyuno_7.5.0.3-3_amd64.deb                   libreoffice7.5-ure_7.5.0.3-3_amd64.deb
20libobasis7.5-graphicfilter_7.5.0.3-3_amd64.deb                         libobasis7.5-writer_7.5.0.3-3_amd64.deb                  libreoffice7.5-writer_7.5.0.3-3_amd64.deb
21➜  DEBS pwd
22/home/mephisto/Downloads/soft/LibreOffice_7.5.0.3_Linux_x86-64_deb/DEBS
23➜  DEBS sudo dpkg -i *.deb

3. 卸載指定版本

經常升級 Libreoffice 的話,多次安裝後會保留多個版本,強迫症一般只會保留想要的版本,這個時候需要刪除特定版本

1sudo apt remove libreoffice-\*

或者

1sudo apt remove --purge libreoffice-\*

例如,我要刪除7.4這個版本,就匹配刪除

1sudo apt remove libreoffice7.4-\*
2sudo apt remove --purge libreoffice7.4-\*

同理,刪除所有 sudo apt remove libreoffice*

如有需要可,同樣可刪除 libobasis 包 sudo apt remove libobasis7.4-\*

這樣操作後,每次都能按照自己喜好,選擇保留合適的 Libreoffice 版本。

最後修改於: Monday, August 28, 2023

相關文章:

翻譯: