每当我尝试运行时sudo apt-get remove codeblocks
都会收到此消息:以下软件包具有未满足的依赖关系:
codeblocks-contrib : Depends: libgamin0 but it is not going to be installed
Depends: libwxsmithlib0 (= 13.12-1) but 13.12-3 is to be installed
Depends: codeblocks (= 13.12-1) but it is not going to be installed
Recommends: cppcheck but it is not going to be installed
Recommends: cscope but it is not going to be installed
Recommends: cccc but it is not going to be installed
codeblocks-dbg : Depends: codeblocks (= 13.12-3) but it is not going to be installed
Depends: codeblocks-contrib (= 13.12-3) but 13.12-1 is to be installed
libwxsmithlib0 : Depends: libcodeblocks0 (= 13.12-3) but 13.12-1 is to be installed
Recommends: codeblocks-contrib (= 13.12-3) but 13.12-1 is to be installed
libwxsmithlib0-dev : Depends: libwxsmithlib-dev (= 13.12-3) 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
,系统提示安装一些软件,然后我遇到此消息和错误:
Unpacking codeblocks-dev (13.12-3) over (13.12-1) ...
dpkg: error processing archive /var/cache/apt/archives/codeblocks-dev_13.12-3_amd64.deb (--unpack):
trying to overwrite '/usr/include/codeblocks/externaldepsdlg.h', which is also in package codeblocks-headers 13.12-1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/codeblocks-dev_13.12-3_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
有什么建议吗?我尝试过 sudo apt-get remove codeblocks,但遇到了与之前几乎相同的未满足依赖关系错误。
我尝试删除 codeblocks 的原因是我正在尝试安装 gnome-themes-standard,但遇到了类似的未满足依赖项错误(列出了相同的软件包)。我猜 apt-get 的某些东西可能已损坏:我最近双启动了 Windows 10 并移动了几个操作系统分区。
我尝试过的解决方案:
sudo dpkg --configure -a
- 移除
codeblocks-contrib
和libwxsmithlib0
sudo apt-get autoclean
sudo apt-get clean
如果有人知道如何解决这个问题,请帮忙。
如果有人好奇的话,我在sudo apt-get update
写这篇文章时确实遇到了这些错误
Reading package lists... Done
W: GPG error: http://download.opensuse.org Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5A7D1D38BEB6D886
W: GPG error: http://ppa.launchpad.net precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B70731143DD9F856
编辑
所以我可以通过http:\\ppa.launchpad.net
以下方法解决 GPG 错误这总结如下:
- 我复制了当前输出的公钥(B70731143DD9F856)
- 在 keyserver.ubuntu.com 中以十六进制形式搜索密钥(基本上用 0x => 格式化
0xB70731143DD9F856
) - 按下公钥链接复制整个文本块(包括 ---begin--- 和 ---end--- 行)
- 将其粘贴到文本编辑器中,另存为 key1
sudo apt-key add key1
在 key1 的目录中运行,然后收到OK
当我重新运行 时sudo apt-get install
,ppa 启动板上的错误消失了,但另一个 GPG 错误仍然存在。在 opensuse 错误中尝试此方法不起作用,因为在 Ubuntu 密钥服务器中搜索没有结果
答案1
今天重新审视这个错误时,我偶然发现了此论坛帖子。事实证明,该问题是由多个 codeblocks 包之间的交叉依赖引起的,因此需要使用此命令修复整个安装:
sudo apt-get purge codeblocks-contrib-dbg codeblocks-libwxcontrib0 codeblocks-dbg \
codeblocks-dev codeblocks codeblocks-headers libcodeblocks0 codeblocks-contrib \
codeblocks-contrib-common codeblocks-wxcontrib-headers codeblocks-wxcontrib-dev \
codeblocks-common libwxsmithlib0 libwxsmithlib0 libwxsmithlib0-dev
在终端中将其复制为一行。处理后,我可以再次成功安装软件。
答案2
你应该运行这个命令:
sudo apt-get purge *codeblocks*