我无法安装任何新软件,任何 apt-get 命令都会返回错误代码 1。在 Ubuntu 软件中心,我收到错误“无法安装新软件,因为当前安装的软件有问题。您想立即修复此问题吗?”如果我单击修复,什么也没有发生。我担心这与最近安装的 Codeblocks 有关。我已经多次重新启动,正如与同一问题相关的其他线程所建议的那样,我已遵循了他们的许多命令。这似乎对他们有用,但对我来说毫无用处。Ubuntu 14.04 64 位。
sudo apt-get -f install returns:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
libbonoboui2-0 libbonoboui2-common libglade2-0 libgnomecanvas2-0
libgnomecanvas2-common libgnomeui-0 libgnomeui-common
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
codeblocks-contrib codeblocks-dev gamin libcodeblocks0 libgamin0
libwxsmithlib-dev
Recommended packages:
valgrind
The following packages will be REMOVED:
codeblocks-headers
The following NEW packages will be installed:
gamin libgamin0 libwxsmithlib-dev
The following packages will be upgraded:
codeblocks-contrib codeblocks-dev libcodeblocks0
3 upgraded, 3 newly installed, 1 to remove and 81 not upgraded.
5 not fully installed or removed.
Need to get 5,309 kB of archives.
After this operation, 1,163 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty/universe codeblocks-dev amd64 13.12-3 [350 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ trusty/universe libcodeblocks0 amd64 13.12-3 [1,807 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu/ trusty/universe gamin amd64 0.1.10-4.1ubuntu1 [41.1 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu/ trusty/universe libgamin0 amd64 0.1.10-4.1ubuntu1 [16.4 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu/ trusty/universe codeblocks-contrib amd64 13.12-3 [3,018 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu/ trusty/universe libwxsmithlib-dev amd64 13.12-3 [75.1 kB]
Fetched 5,309 kB in 8s (643 kB/s)
(Reading database ... 338385 files and directories currently installed.)
Preparing to unpack .../codeblocks-dev_13.12-3_amd64.deb ...
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)
答案1
首先使用以下命令清理导致问题的程序,
sudo apt-get clean
sudo apt-get -f 安装
sudo apt-get 更新
此后尝试安装该软件。
答案2
我能够通过使用 Synaptics 包管理器(希望遇到此问题的人已经安装了它,否则我不知道该说什么。)来删除 Codeblocks 的任何痕迹,从而解决该问题。虽然我很想使用它,但恐怕我不得不选择其他东西,或者继续寻找更好的解决方案。谢谢。