每当我尝试运行时sudo apt-get -f install
都会出现此错误。以下是所有输出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:
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 20 not upgraded.
5 not fully installed or removed.
Need to get 0 B/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
(Reading database ... 174515 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
codeblock-headers 正在被删除,但是由于某种原因 apt-get 不会先执行此操作,您只需手动删除它,然后安装您需要安装的内容:
sudo apt-get remove codeblocks-headers
sudo apt-get install codeblocks-contrib
我也会向软件包维护人员报告此问题。
答案2
尝试运行:
sudo dpkg -i --force-overwrite /var/cache/apt/archives/codeblocks-dev_13.12-3_amd64.deb
然后运行:
sudo apt-get -f install
来源:如何解决“dpkg:错误处理/var/cache/apt/archives/python-apport_2.0.1-0ubuntu9_all.deb”?
或者
sudo apt-get remove codeblocks-dev && sudo apt-get install -f && sudo apt-get install codeblocks-dev
答案3
诀窍是当你删除/清除一个包时!
用一个命令删除或清除它们全部,
对我有用的是:
sudo apt-get remove codeblocks-contrib codeblocks-dbg codeblocks-contrib-dbg
日志
younes@awesomeHostName:~$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
codeblocks-contrib
Recommended packages:
valgrind
The following packages will be upgraded:
codeblocks-contrib
1 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
17 not fully installed or removed.
Need to get 0 B/3,018 kB of archives.
After this operation, 1,162 kB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.
younes@awesomeHostName:~$ sudo apt-get remove codeblocks-contrib
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:
codeblocks-dbg : Depends: codeblocks-contrib (= 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).
younes@awesomeHostName:~$ sudo apt-get remove codeblocks-contrib codeblocks-dbg
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:
codeblocks-contrib-dbg : Depends: codeblocks-dbg (= 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).
younes@awesomeHostName:~$ sudo apt-get remove codeblocks-contrib codeblocks-dbg codeblocks-contrib-dbg
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
codeblocks-contrib codeblocks-contrib-dbg codeblocks-dbg
0 upgraded, 0 newly installed, 3 to remove and 5 not upgraded.
17 not fully installed or removed.
After this operation, 365 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 114672 files and directories currently installed.)
Removing codeblocks-contrib-dbg (13.12-3) ...
Removing codeblocks-dbg (13.12-3) ...
Removing codeblocks-contrib (13.12-1) ...
Setting up libwxbase2.8-0:amd64 (2.8.12.1+dfsg-2ubuntu2) ...
Setting up libwxgtk2.8-0:amd64 (2.8.12.1+dfsg-2ubuntu2) ...
Setting up codeblocks-common (13.12-3) ...
Setting up libcodeblocks0 (13.12-3) ...
Setting up codeblocks (13.12-3) ...
Setting up codeblocks-dev (13.12-3) ...
Setting up codeblocks-libwxcontrib0 (13.12-1) ...
Setting up codeblocks-wxcontrib-dev (13.12-1) ...
Setting up codeblocks-wxcontrib-headers (13.12-1) ...
Setting up libwxsmithlib0 (13.12-3) ...
Setting up libwxsmithlib-dev (13.12-3) ...
Setting up libwxsmithlib0-dev (13.12-3) ...
Setting up gamin (0.1.10-4.1ubuntu1) ...
Setting up libgamin0 (0.1.10-4.1ubuntu1) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
younes@awesomeHostName:~$