我卸载了 Libreoffice,只安装了 Openoffice,结果发现我不再喜欢 OpenOffice。我今天卸载了 OpenOffice,并尝试安装 LibreOffice,但出现了错误。
The following packages have unmet dependencies:
libreoffice-core : Depends: libreoffice-common (> 1:4.2.7) but it is not installed
libreoffice-help-en-us : Depends: libreoffice-l10n-en-us
libreoffice-java-common : Depends: libreoffice-common but it is not installed
libreoffice-l10n-en-gb : Depends: libreoffice-common but it is not installed
libreoffice-l10n-en-za : Depends: libreoffice-common but it is not installed
y-ppa-manager : Depends: yad (>= 0.8.0) but it is not installed
Depends: python-software-properties but it is not installed
所以我尝试这样做sudo apt-get -f install
,并且系统要求我安装,我说是的,这是消息。
$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
libreoffice-common
Suggested packages:
libreoffice-style-crystal libreoffice-style-hicontrast
libreoffice-style-oxygen libreoffice-style-sifr libreoffice-style-tango
The following NEW packages will be installed:
libreoffice-common
0 upgraded, 1 newly installed, 0 to remove and 10 not upgraded.
41 not fully installed or removed.
Need to get 0 B/19.9 MB of archives.
After this operation, 76.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 453874 files and directories currently installed.)
Preparing to unpack .../libreoffice-common_1%3a4.2.7-0ubuntu1_all.deb ...
Unpacking libreoffice-common (1:4.2.7-0ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/libreoffice-common_1%3a4.2.7-0ubuntu1_all.deb (--unpack):
trying to overwrite '/usr/bin/soffice', which is also in package openoffice-debian-menus 4.1-9764
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
Processing triggers for gnome-menus (3.10.1-0ubuntu2) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu1) ...
Processing triggers for bamfdaemon (0.5.1+14.04.20140409-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.54ubuntu1) ...
Processing triggers for shared-mime-info (1.2-0ubuntu3) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for gnome-icon-theme (3.10.0-0ubuntu2) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
Errors were encountered while processing:
/var/cache/apt/archives/libreoffice-common_1%3a4.2.7-0ubuntu1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我无法再安装任何东西或更新我的系统。
答案1
在做了一些研究并学习了一些新技巧后,我自己回答了这个问题。如果有人遇到与这些损坏的依赖项相关的问题,我将提供答案。我使用 synaptic 包管理器删除了损坏的包。以下是我这样做的方法
首先我下载了 Synaptic 包管理器Synaptic 软件包管理器
然后我将下载的 .deb 文件移动到我的主文件夹(以便于终端访问),然后继续打开终端
CTRL + ALT + T
我必须通过 dpkg 安装该软件包,因为 apt-get 因依赖关系损坏而无法工作
sudo dpkg -i synaptic_0.81.1_amd64.deb
完成后我打开了突触,在终端中运行以下命令
sudo synaptic
在 Synaptic 包管理器中
点击Status Tab
然后单击Broken
并选择损坏的软件包。并Mark for Complete Removal
继续应用更改。
我还通过在终端中使用以下命令确保所有内容都被彻底删除
sudo apt-get autoremove
并在突触包管理器中仔细检查包
没有剩余的自由办公软件包,所以我继续通过 Ubuntu 软件中心安装 Libre Office
答案2
如果你有这个问题,请这样做:
sudo mkdir /usr/bin/soffice
sudo apt-get -f install -y
答案3
我知道这种情况几年前就发生过,但我在使用 18.04 LTS (Bionic) 时也遇到过类似的情况。我的电脑卡住了,无法更新、无法安装……什么都没有。所以......
我解决问题的唯一方法是安装名为 libreoffice-common 的软件包。在这里我发现了 dpkg 错误消息显示:
dpkg:处理档案 /var/cache/apt/archives/libreoffice-common_1%3a6.0.3-0ubuntu1_all.deb (--unpack) 时出错:试图覆盖“/usr/bin/soffice”,后者也在软件包 openoffice-debian-menus 4.1.4-9788 中 rmdir:无法删除“/var/lib/libreoffice/share/prereg/”:没有此文件或目录 rmdir:无法删除“/var/lib/libreoffice/share/”:没有此文件或目录 rmdir:无法删除“/var/lib/libreoffice/program/”:没有此文件或目录 rmdir:无法删除“/var/lib/libreoffice”:没有此文件或目录 rmdir:无法删除“/var/lib/libreoffice”:没有此文件或目录 处理时遇到错误: /var/cache/apt/archives/libreoffice-common_1%3a6.0.3-0ubuntu1_all.deb E: 子进程 /usr/bin/dpkg 返回错误代码 (1)”
我必须仔细阅读错误消息。它告诉我另一个名为 openoffice-debian-menus 的应用程序正在使用位于 /usr/bin/soffice 的文件。由于某种原因,无法覆盖此文件。
所以我使用 dpkg 删除了该程序:sudo dpkg -P openoffice-debian-menus 4.1.4-9788
已安装 libreoffice-common:sudo apt install libreoffice-common
运行更新:sudo apt update && sudo apt list --upgradable
运行上述命令后,使用以下命令验证是否要将软件包包含在升级中:sudo apt show pkgs“软件包名称”。如果一切正常,请运行 sudo apt full-upgrade && sudo apt autoremove。
我希望一切顺利。
答案4
尝试:
sudo dpkg -i --force-overwrite /var/cache/apt/archives/libreoffice-common_1%3a4.2.7-0ubuntu1_all.deb
然后:
sudo apt-get -f install
sudo ap-get install libreoffice
来源:如何解决“dpkg:错误处理/var/cache/apt/archives/python-apport_2.0.1-0ubuntu9_all.deb”?