尽管 libreoffice 存在未满足的依赖性错误,如何安装和升级其他软件?

尽管 libreoffice 存在未满足的依赖性错误,如何安装和升级其他软件?

TLDR:当我尝试运行apt-get install或时apt-get upgrade,所需的操作没有发生,并且我收到有关 libreoffice 未满足依赖关系的错误消息。

最近,当我尝试通过键入sudo apt-get install等在命令行中安装程序时,该程序无法安装,并且我收到有关 libreoffice 的错误消息:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 libreoffice-style-breeze : Depends: libreoffice-common (= 1:5.1.6~rc2-0ubuntu1~xenial2) but 1:5.1.6~rc2-0ubuntu1~xenial1 is to be installed
 libreoffice-style-galaxy : Depends: libreoffice-common (= 1:5.1.6~rc2-0ubuntu1~xenial2) but 1:5.1.6~rc2-0ubuntu1~xenial1 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

当我尝试运行时,我得到了相同的响应sudo apt-get upgrade

当我运行时sudo apt-get -f install,它告诉我:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-71 linux-headers-4.4.0-71-generic linux-image-4.4.0-71-generic
  linux-image-extra-4.4.0-71-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libreoffice-common
Suggested packages:
  libreoffice-style-hicontrast libreoffice-style-human libreoffice-style-oxygen
  libreoffice-style-sifr libreoffice-style-tango
The following packages will be upgraded:
  libreoffice-common
1 upgraded, 0 newly installed, 0 to remove and 55 not upgraded.
2 not fully installed or removed.
Need to get 0 B/22.2 MB of archives.
After this operation, 1,024 B of additional disk space will be used.
Do you want to continue? [Y/n]

我告诉终端Y。它回复道:

(Reading database ... 273520 files and directories currently installed.)
Preparing to unpack .../libreoffice-common_1%3a5.1.6~rc2-0ubuntu1~xenial2_all.deb ...
Unpacking libreoffice-common (1:5.1.6~rc2-0ubuntu1~xenial2) over (1:5.1.6~rc2-0ubuntu1~xenial1) ...
dpkg: error processing archive /var/cache/apt/archives/libreoffice-common_1%3a5.1.6~rc2-0ubuntu1~xenial2_all.deb (--unpack):
 unable to open '/usr/lib/libreoffice/share/template/wizard/bitmap/euro_3.bmp.dpkg-new': Operation not permitted
Segmentation fault (core dumped)

当我尝试安装其他程序时,出现此错误:

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 

因此,我运行sudo dpkg --configure -a并得到以下响应:

dpkg: dependency problems prevent configuration of libreoffice-style-galaxy:
 libreoffice-style-galaxy depends on libreoffice-common (= 1:5.1.6~rc2-0ubuntu1~xenial2); however:
  Version of libreoffice-common on system is 1:5.1.6~rc2-0ubuntu1~xenial1.

dpkg: error processing package libreoffice-style-galaxy (--configure):
 dependency problems - leaving unconfigured
Processing triggers for man-db (2.7.5-1) ...
Setting up shared-mime-info (1.5-2ubuntu0.1) ...
dpkg: dependency problems prevent configuration of libreoffice-style-breeze:
 libreoffice-style-breeze depends on libreoffice-style-galaxy; however:
  Package libreoffice-style-galaxy is not configured yet.
 libreoffice-style-breeze depends on libreoffice-common (= 1:5.1.6~rc2-0ubuntu1~xenial2); however:
  Version of libreoffice-common on system is 1:5.1.6~rc2-0ubuntu1~xenial1.

dpkg: error processing package libreoffice-style-breeze (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libreoffice-style-galaxy
 libreoffice-style-breeze

我仍然无法成功运行apt-get installapt-get upgrade,因此我尝试通过完全删除 libreofficesudo apt-get remove --purge libreoffice*并收到以以下内容结尾的长回复......

You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 python3-uno : Depends: libreoffice-core (= 1:5.1.6~rc2-0ubuntu1~xenial2) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

我再次尝试sudo apt-get -f install并得到以下结果:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.4.0-71 linux-headers-4.4.0-71-generic linux-image-4.4.0-71-generic
  linux-image-extra-4.4.0-71-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libreoffice-common
Suggested packages:
  libreoffice-style-hicontrast libreoffice-style-human libreoffice-style-oxygen
  libreoffice-style-sifr libreoffice-style-tango
The following packages will be upgraded:
  libreoffice-common
1 upgraded, 0 newly installed, 0 to remove and 55 not upgraded.
2 not fully installed or removed.
Need to get 0 B/22.2 MB of archives.
After this operation, 1,024 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 273520 files and directories currently installed.)
Preparing to unpack .../libreoffice-common_1%3a5.1.6~rc2-0ubuntu1~xenial2_all.deb ...
Unpacking libreoffice-common (1:5.1.6~rc2-0ubuntu1~xenial2) over (1:5.1.6~rc2-0ubuntu1~xenial1) ...
dpkg: error processing archive /var/cache/apt/archives/libreoffice-common_1%3a5.1.6~rc2-0ubuntu1~xenial2_all.deb (--unpack):
 unable to open '/usr/lib/libreoffice/share/gallery/htmlexpo/grenav.gif.dpkg-new': Operation not permitted
Segmentation fault (core dumped)

我在网上查看过类似的问题,但似乎只是在兜圈子。我该如何解决这个问题,以便我可以安装其他程序?

答案1

我能够让它工作。看来我的 Sophos AV 阻止了更新。

 sudo /opt/sophos-av/bin/savdctl disable
 sudo apt-get install -f
 sudo apt-get upgrade
 sudo /opt/sophos-av/bin/savdctl enable

相关内容