apt-get:如何覆盖另一个包中的现有文件?

apt-get:如何覆盖另一个包中的现有文件?

我正在尝试使用源代码为 Natty 安装 Gnome3 ,但是出现以下错误:deb http://ppa.launchpad.net/gnome3-team/gnome3/ubuntu natty main

$ sudo apt-get install -f
...
Unpacking replacement gnome-games-common ...
dpkg: error processing /var/cache/apt/archives/gnome-games-common_1%3a3.0.0-      0ubuntu1~build1_i386.deb (--unpack):
 trying to overwrite '/usr/share/gnome-games-common/cards/bonded.svg', which is also in     package gnome-games-extra-data 2.30.0-1ubuntu1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/gnome-games-common_1%3a3.0.0-0ubuntu1~build1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

在解决上述问题之前,我sudo apt-get remove gnome-games-common也无法解决:gnome-games-extra-data

$ sudo apt-get remove gnome-games-common
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:
 aisleriot : Depends: gnome-games-common (>= 1:3.0.0-0ubuntu1~build1) but it is not going to be installed
 glchess : Depends: gnome-games-common (>= 1:3.0.0-0ubuntu1~build1) but it is not going to be installed
 glines : Depends: gnome-games-common (>= 1:3.0.0-0ubuntu1~build1) but it is not going to be installed
 gnect : Depends: gnome-games-common (>= 1:3.0.0-0ubuntu1~build1) but it is not going to be installed
 gnibbles : Depends: gnome-games-common (>= 1:3.0.0-0ubuntu1~build1) but it is not going to be installed
 gnobots2 : Depends: gnome-games-common (>= 1:3.0.0-0ubuntu1~build1) but it is not going to be installed
 gnome-mahjongg : Depends: gnome-games-common (>= 1:3.0.0-0ubuntu1~build1) but it is not going to be installed
 gnome-sudoku : Depends: gnome-games-common (>= 1:2.32.1-0ubuntu5) but it is not going to be installed
 gnomine : Depends: gnome-games-common (>= 1:3.0.0-0ubuntu1~build1) but it is not going to be installed
 gnotravex : Depends: gnome-games-common (>= 1:3.0.0-0ubuntu1~build1) but it is not going to be installed
 gnotski : Depends: gnome-games-common (>= 1:3.0.0-0ubuntu1~build1) but it is not going to be installed
 gtali : Depends: gnome-games-common (>= 1:3.0.0-0ubuntu1~build1) but it is not going to be installed
 iagno : Depends: gnome-games-common (>= 1:3.0.0-0ubuntu1~build1) but it is not going to be installed
 lightsoff : Depends: gnome-games-common (>= 1:2.32.1-0ubuntu5) but it is not going to be installed
 quadrapassel : Depends: gnome-games-common (>= 1:3.0.0-0ubuntu1~build1) but it is not going to be installed
 swell-foop : Depends: gnome-games-common (>= 1:2.32.1-0ubuntu5) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

我只想覆盖现有文件/usr/share/gnome-games-common/cards/bonded.svg,可以吗?

答案1

尝试运行:

sudo dpkg --purge gnome-games gnome-games-common gnome-games-extra-data

删除有问题的软件包。如果软件包拒绝被删除,你可以运行:

sudo dpkg --force-overwrite --purge gnome-games gnome-games-common gnome-games-extra-data

然后清除 apt 缓存并重新安装它们:

sudo apt-get clean
sudo apt-get install gnome-games gnome-games-common gnome-games-extra-data

答案2

您应该尝试删除gnome-games-extra-data,而不是gnome-games-common。我尝试gnome-games-extra-data从 ppa 安装并更新 Gnome,没有出现错误。按相反顺序执行此操作会导致 apt 出错。

答案3

我按照上面的建议按名称删除每个游戏。它给了我更多错误,但列出了存在依赖性问题的其他应用程序和游戏。我也删除了那些,然后 sudo apt-get update,它自动要求我安装 gnome-games-common。从那里开始,一切似乎都运行良好。

相关内容