升级到 Trusty 时出现“dpkg:尝试覆盖软件包 gnome-settings-daemon 中的‘.../gsettings/gnome-settings-daemon.convert’”

升级到 Trusty 时出现“dpkg:尝试覆盖软件包 gnome-settings-daemon 中的‘.../gsettings/gnome-settings-daemon.convert’”

升级到 14.04 时,我遇到了依赖性问题gnome-settings-daemon-schemas,导致升级受阻。运行后,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:
  gnome-settings-daemon-schemas
The following NEW packages will be installed:
  gnome-settings-daemon-schemas
0 upgraded, 1 newly installed, 0 to remove and 530 not upgraded.
9 not fully installed or removed.
Need to get 0 B/44.2 kB of archives.
After this operation, 189 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 252639 files and directories currently installed.)
Preparing to unpack .../gnome-settings-daemon-schemas_3.8.6.1-0ubuntu11_all.deb ...
Unpacking gnome-settings-daemon-schemas (3.8.6.1-0ubuntu11) ...
dpkg: error processing archive /var/cache/apt/archives/gnome-settings-daemon-schemas_3.8.6.1-0ubuntu11_all.deb (--unpack):
 trying to overwrite '/usr/share/GConf/gsettings/gnome-settings-daemon.convert', which is also in package gnome-settings-daemon 3.10.2-0ubuntu1~saucy6

Processing triggers for gconf2 (3.2.6-0ubuntu2) ...
Errors were encountered while processing:
 /var/cache/apt/archives/gnome-settings-daemon-schemas_3.8.6.1-0ubuntu11_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
   Depends: gnome-settings-daemon-schemas (< 3.10) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

是什么原因造成的?我该如何解决?


如果相关的话,这里是原始的依赖地狱:

The following packages have unmet dependencies:
 aptitude : Depends: aptitude-common (= 0.6.8.2-1ubuntu4) but it is not going to be installed
            Depends: libboost-iostreams1.54.0 but it is not going to be installed
            Depends: libcwidget3 but it is not going to be installed
            Depends: libept1.4.12 but it is not going to be installed
 compiz-gnome : Depends: gnome-settings-daemon-schemas (>= 3.4.2-0ubuntu9) but it is not going to be installed
 unity-settings-daemon : Depends: gnome-settings-daemon-schemas (>= 3.8) but it is not going to be installed
                         Depends: gnome-settings-daemon-schemas (< 3.10) but it is not going to be installed

答案1

首先,我尝试编辑您的问题并将其变为以下错误的典型问题:

Unpacking package_name ...
    dpkg: error processing archive /path/to/archive_name.deb (--unpack):
     trying to overwrite 'file_name', which is also in package another_package_name

我的回答不仅针对一般情况,也针对您的具体情况:

  1. 您可以通过运行来解决您的问题:

    sudo dpkg -i --force-overwrite /path/to/archive_name.deb
    • 在您的具体情况下:

      sudo dpkg -i --force-overwrite /var/cache/apt/archives/gnome-settings-daemon-schemas_3.8.6.1-0ubuntu11_all.deb
      
  2. 如果第一步不起作用,请运行:

    sudo dpkg -i --force-all /path/to/archive_name.deb
    • 在您的具体情况下:

      sudo dpkg -i --force-all /var/cache/apt/archives/gnome-settings-daemon-schemas_3.8.6.1-0ubuntu11_all.deb
      
  3. 最后再次运行:

    sudo apt-get -f install
    
    • 如果您对另一个包有同样的问题,请从第一步重新开始。

来源

答案2

出现此错误的原因是,在安装之前没有删除/清除 gnome ppa以及软件包。这是显而易见的,因为这些软件包 gnome-settings-daemon 3.10.2-0ubuntu1~saucy6 并不存在于 saucy 存储库中,而是存在于 gnome PPA 中。

您可以尝试使用 dpkg 逐个删除所有以 saucy 结尾的包:

sudo dpkg --remove package

删除所有 PPA 存储库并使用aptitude remove '?version(*saucy*)'(如果您有 synaptic,那是另一种选择)如果您已经安装它,请降级它,或者重新安装您的系统。

答案3

我最近也遇到了这个问题。我不仅必须删除我手动添加的 Gnome 存储库以保持领先地位,还必须清除所有可能妨碍的 Gnome 软件包(即来自该存储库的软件包),然后在apt-get update安装后gnome-shell版本后可靠repos,当然,它带来了它的所有依赖项,包括gnome-settings-daemon-schemas。希望你的里程不会有太大差异。

答案4

尝试运行此命令

sudo aptitude install gnome-settings-daemon

參考文獻:https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/1278863/comments/16

相关内容