试图修复破坏的依赖项(Libre Office)

我卸载了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) 

我无法再安装任何东西或更新我的系统。

在做了一些研究并学习一些新技巧后,我自己也回答了这个问题。 我将提供答案,以防有人遇到与这些破坏的依赖关系相关的问题。 我使用了synaptic包管理器来删除损坏的包。 我就是这样做的

首先我下载了​​Synaptic Package Manager Synaptic Package Manager

然后我将下载的.deb文件移动到我的主文件夹(以方便终端访问),然后继续打开终端

 CTRL + ALT + T 

我不得不通过dpkg安装软件包,因为apt-get由于依赖性破坏而无法正常工作

 sudo dpkg -i synaptic_0.81.1_amd64.deb 

一旦完成,我打开了突触运行终端中的以下内容

 sudo synaptic 

在Synaptic Package Manager中

单击“ Status Tab

然后单击Broken并选择已损坏的包。 并Mark for Complete Removal并继续应用更改。

我还确保在终端中使用以下内容完全删除了所有内容

 sudo apt-get autoremove 

并仔细检查synaptic包管理器中的包

没有剩下的libre办公室套餐,所以我继续通过Ubuntu软件中心安装Libre Office

如果您有此问题,请执行以下操作:

 sudo mkdir /usr/bin/soffice sudo apt-get -f install -y 

一个接一个地尝试这些:

 sudo apt-get purge openoffice* sudo apt-get clean && sudo apt-get autoclean sudo apt-get autoremove sudo apt-get install libreoffice 

尝试:

 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 

source: 如何解决“dpkg:error processing /var/cache/apt/archives/python-apport_2.0.1-0ubuntu9_all.deb”?

我理解这发生在几年前,但我有18.04 LTS(Bionic)类似的情况。 我的电脑卡住了,没有更新,安装……什么都没有。 所以……

解决问题的唯一方法是安装名为libreoffice-common的软件包。 这是我发现显示dpkg错误消息的地方:

dpkg:error handling存档/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

Ran更新:sudo apt update && sudo apt list –upgradable

运行上一个命令后,使用以下命令validation是否需要升级中包含的软件包:sudo apt show pkgs“软件包名称”。 如果一切正常,请运行sudo apt full-upgrade && sudo apt autoremove。

我希望一切顺利。