dpkg 尝试覆盖 /use/share/metainfo/granite.appdata.xml 时出错,该 xml 也位于 libgranite-common 中

dpkg 尝试覆盖 /use/share/metainfo/granite.appdata.xml 时出错,该 xml 也位于 libgranite-common 中

我努力了此解决方案但是 dpkg 似乎也无法删除该依赖项。这是我尝试修复损坏的依赖项时的终端输出:

ayon@schneizel:/usr/share/applications$ sudo apt install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
  libfwupdplugin1
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  libgranite5
The following NEW packages will be installed:
  libgranite5
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/167 kB of archives.
After this operation, 650 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 122024 files and directories currently installed.)
Preparing to unpack .../libgranite5_5.3.0-1_amd64.deb ...
Unpacking libgranite5:amd64 (5.3.0-1) ...
dpkg: error processing archive /var/cache/apt/archives/libgranite5_5.3.0-1_amd64.deb (--unpack):
 trying to overwrite '/usr/share/metainfo/granite.appdata.xml', which is also in package libgranite-common 6.2
.0+r2223+pkg122~ubuntu6.1
Errors were encountered while processing:
 /var/cache/apt/archives/libgranite5_5.3.0-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

当我尝试删除该包(或其他包)时,这是我的终端输出:

ayon@schneizel:/usr/share/applications$ sudo dpkg -P libgranite-common
dpkg: dependency problems prevent removal of libgranite-common:
 libgranite6:amd64 depends on libgranite-common (>= 6.2.0+r2223+pkg122~ubuntu6.1).

dpkg: error processing package libgranite-common (--purge):
 dependency problems - not removing
Errors were encountered while processing:
 libgranite-common

答案1

您尝试安装包,但它与系统中已安装的libgranite5_5.3.0包发生冲突。libgranite-common 6.2.0

dpkg -P命令无法运行,因为其他一些软件包需要它。这里是libgranite6,甚至一些软件包也依赖于libgranite6

作为一种解决方法,您可以使用 apt 命令来删除它以及依赖项:

sudo apt remove --autoremove libgranite-common

留意终端输出,它会告诉您在输入“y”并按回车键之前要删除哪些包。

或者,如果apt命令拒绝工作,请使用:

sudo dpkg -P libgranite6

它会删除该软件包,或者因为其他软件包依赖它而拒绝。您必须删除所有依赖软件包,才能安装libgranite5_5.3.0

如果可能的话我建议使用Synaptic 软件包管理器对初学者更加友好。

相关内容