由于 gconf 依赖性不好导致运行 dpkg 出现问题

由于 gconf 依赖性不好导致运行 dpkg 出现问题

apt由于一些依赖问题,我无法运行任何操作。

如果我运行,sudo apt-get upgrade我会得到以下结果:

You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 gconf-service-backend : Depends: libgconf-2-4 (= 3.2.6-4ubuntu1) but 3.2.6-4.1 is installed
 gconf2 : Depends: gconf-service (= 3.2.6-4.1)
 libgconf-2-4 : Depends: gconf2-common (= 3.2.6-4.1) but 3.2.6-4ubuntu1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

但在运行时apt --fix-broken install我得到了这个:

dpkg: error processing archive /var/cache/apt/archives/gconf-service_3.2.6-4.1_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/gconf/2/libgconfbackend-evoldap.so', which is also in package gconf-service-backend 3.2.6-4ubuntu1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/gconf-service_3.2.6-4.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我尝试运行sudo dpkg configure -a但得到以下结果:

dpkg: dependency problems prevent configuration of gconf2:
 gconf2 depends on gconf-service (= 3.2.6-4.1); however:
  Version of gconf-service on system is 3.2.6-4ubuntu1.

dpkg: error processing package gconf2 (--configure):
 dependency problems - leaving unconfigured
Setting up linux-image-extra-4.13.0-37-generic (4.13.0-37.42) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.13.0-37-generic /boot/vmlinuz-4.13.0-37-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.13.0-37-generic /boot/vmlinuz-4.13.0-37-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.13.0-37-generic /boot/vmlinuz-4.13.0-37-generic
update-initramfs: Generating /boot/initrd.img-4.13.0-37-generic

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.13.0-37-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.13.0-37-generic (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of libgconf-2-4:amd64:
 libgconf-2-4:amd64 depends on gconf2-common (= 3.2.6-4.1); however:
  Version of gconf2-common on system is 3.2.6-4ubuntu1.

dpkg: error processing package libgconf-2-4:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-image-extra-4.13.0-37-generic; however:
  Package linux-image-extra-4.13.0-37-generic is not configured yet.

dpkg: error processing package linux-image-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-signed-image-generic:
 linux-signed-image-generic depends on linux-image-extra-4.13.0-37-generic; however:
  Package linux-image-extra-4.13.0-37-generic is not configured yet.

dpkg: error processing package linux-signed-image-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (= 4.13.0.37.40); however:
  Package linux-image-generic is not configured yet.

dpkg: error processing package linux-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-signed-generic:
 linux-signed-generic depends on linux-signed-image-generic (= 4.13.0.37.40); however:
  Package linux-signed-image-generic is not configured yet.

dpkg: error processing package linux-signed-generic (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 gconf2
 linux-image-extra-4.13.0-37-generic
 libgconf-2-4:amd64
 linux-image-generic
 linux-signed-image-generic
 linux-generic
 linux-signed-generic

由于 gconf 3.2.6-4.1 和 3.2.6-4ubuntu1 之间存在奇怪的差异,我似乎陷入了依赖地狱。有人有什么建议吗?

谢谢。

答案1

您需要强制覆盖该文件。

sudo dpkg -i --force-overwrite /var/cache/apt/archives/gconf-service_3.2.6-4.1_amd64.deb

答案2

如果所有修复方法都失败了,请移除gconf2

sudo apt-get remove gconf2

您还可以删除列表中显示的其他具有相同行为的问题软件包,最后sudo apt-get update && sudo apt-get upgrade

相关内容