使用 apt 安装时 LibreOffice 与 OpenOffice 发生冲突

使用 apt 安装时 LibreOffice 与 OpenOffice 发生冲突

我尝试安装 kubuntu-desktop,但 LibreOffice 出现错误。我无法再使用 apt 安装软件包,当我尝试使用 sudo apt install -f 时。每次我尝试使用 apt 执行任何操作时,都会出现错误

Reading package lists... Done
Building dependency tree       
Reading state information... Done
kubuntu-desktop is already the newest version (1.398).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libreoffice-core : Depends: libreoffice-common (> 1:6.4.6) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
sudo apt install -f

返回

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libreoffice-common
The following NEW packages will be installed:
  libreoffice-common
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
11 not fully installed or removed.
Need to get 0 B/23.5 MB of archives.
After this operation, 56.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 349645 files and directories currently installed.)
Preparing to unpack .../libreoffice-common_1%3a6.4.6-0ubuntu0.20.04.1_all.deb ...
Unpacking libreoffice-common (1:6.4.6-0ubuntu0.20.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/libreoffice-common_1%3a6.4.6-0ubuntu0.20.04.1_all.deb (--unpack):
 trying to overwrite '/usr/bin/soffice', which is also in package openoffice-debian-menus 4.1.8-9803
rmdir: failed to remove '/var/lib/libreoffice/share/prereg/': No such file or directory
rmdir: failed to remove '/var/lib/libreoffice/share/': No such file or directory
rmdir: failed to remove '/var/lib/libreoffice/program/': No such file or directory
rmdir: failed to remove '/var/lib/libreoffice': No such file or directory
rmdir: failed to remove '/var/lib/libreoffice': No such file or directory
Errors were encountered while processing:
 /var/cache/apt/archives/libreoffice-common_1%3a6.4.6-0ubuntu0.20.04.1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

OpenOffice 与 LibreOffice 不应互相安装。

它们是同一软件的分支,如果您尝试在同一系统上安装它们,它们会相互冲突。

答案2

通过使用找到修复

sudo dpkg --remove --force-remove-reinstreq \
       libreoffice-writer libreoffice-qt5 libreoffice-kf5 libreoffice-core \
       libreoffice-math python3-uno libreoffice-impress libreoffice-draw \
       libreoffice-calc libreoffice-plasma libreoffice-base-core

相关内容