3

This happened after I installed latest version of Code Blocks downloaded from official site, I was not able to run it, so I've been tried to remove it (sudo apt-get remove) and this happened.

Then I tried:

sudo apt-get clean
sudo apt-get autoclean
sudo apt-get -f install

and got this:

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:
  geany-common lib32gcc1 lib32stdc++6 libatk-adaptor libgail-common
  liblouis-data liblouis2 python3-brlapi python3-louis python3-pyatspi
  python3-speechd
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  codeblocks-contrib codeblocks-dev
Recommended packages:
  valgrind
The following packages will be upgraded:
  codeblocks-contrib codeblocks-dev
2 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
4 not fully installed or removed.
Need to get 3 369 kB of archives.
After this operation, 2 954 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ru.archive.ubuntu.com/ubuntu/ trusty/universe codeblocks-contrib amd64 13.12-3 [3 018 kB]
Get:2 http://ru.archive.ubuntu.com/ubuntu/ trusty/universe codeblocks-dev amd64 13.12-3 [350 kB]
Fetched 3 369 kB in 0s (5 731 kB/s)      
(Reading database ... 337359 files and directories currently installed.)
Preparing to unpack .../codeblocks-contrib_13.12-3_amd64.deb ...
Unpacking codeblocks-contrib (13.12-3) over (13.12-1) ...
dpkg: error processing archive /var/cache/apt/archives/codeblocks-contrib_13.12-3_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/pkgconfig/cb_wximagepanel.pc', which is also in package codeblocks-wxcontrib-dev 13.12-1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
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/wxContribItems/wxImagePanel/include/wx/wxImagePanel.h', which is also in package codeblocks-wxcontrib-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-contrib_13.12-3_amd64.deb
 /var/cache/apt/archives/codeblocks-dev_13.12-3_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Additional info:

$ apt-cache policy libwxsmithlib0
libwxsmithlib0:
  Installed: 13.12-3
  Candidate: 13.12-3
  Version table:
 *** 13.12-3 0
        500 http://ru.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status

$ apt-cache policy codeblocks
codeblocks:
  Installed: 13.12-3
  Candidate: 13.12-3
  Version table:
 *** 13.12-3 0
        500 http://ru.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status

$ apt-cache policy codeblocks-contrib
codeblocks-contrib:
  Installed: 13.12-1
  Candidate: 13.12-3
  Version table:
     13.12-3 0
        500 http://ru.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
 *** 13.12-1 0
        100 /var/lib/dpkg/status

$ sudo apt-get install codeblocks-contrib=13.12-3
[sudo] password for user: 
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-dev : Depends: libcodeblocks0 (= 13.12-1) but 13.12-3 is to be installed
                  Depends: codeblocks-headers (= 13.12-1) but it is not installable
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

$ apt-cache policy codeblocks-dev
codeblocks-dev:
  Installed: 13.12-1
  Candidate: 13.12-3
  Version table:
     13.12-3 0
        500 http://ru.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
 *** 13.12-1 0
        100 /var/lib/dpkg/status

$ sudo apt-get install codeblocks-dev=13.12-3
[sudo] password for user: 
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 : Depends: libwxsmithlib0 (= 13.12-1) but 13.12-3 is to be installed
                      Depends: codeblocks (= 13.12-1) but 13.12-3 is to be installed
                      Recommends: valgrind 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-contrib (= 13.12-3) but 13.12-1 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
17
  • It's apt-get install -f. I don't know if it'll have a different output, but you can try. Sep 30, 2015 at 22:46
  • @Zacharee1 there's no difference between sudo apt-get -f install and sudo apt-get install -f.
    – terdon
    Sep 30, 2015 at 23:03
  • @terdon got it. Sep 30, 2015 at 23:16
  • Try uninstalling codeblocks-wxcontrib-dev. Sep 30, 2015 at 23:16
  • @Zacharee1 does not work
    – R S
    Oct 1, 2015 at 10:45

1 Answer 1

2

The answer is in your error message. The packages codeblocks-headers and codeblocks-dev tries to overwrite files, which are also in the packages codeblocks-wxcontrib-headers and codeblocks-wxcontrib-dev.

But after some clarifications in the chat

dpkg -l | awk '/ codeblocks-/ {system("sudo dpkg -r --force-all " $2)}'
sudo dpkg -r --force-all  libcodeblocks0

And as you said in the comments

I removed this packages by "rm -rf" but it did not help: /usr/bin/codeblocks /usr/lib/codeblocks /usr/bin/X11/codeblocks /usr/include/codeblocks /usr/share/codeblocks /usr/share/man/man1/codeblocks.1.gz

That makes no sense. You have deleted some files but no packages.


Now, if you need codeblocks again, reinstall via

sudo apt-get install codeblocks
11
  • I can't: The following packages have unmet dependencies: codeblocks-contrib : Depends: libwxsmithlib0 (= 13.12-1) but 13.12-3 is to be installed Depends: codeblocks (= 13.12-1) but 13.12-3 is to be installed ...
    – R S
    Oct 1, 2015 at 10:43
  • @RS how are you trying to remove them? Oct 1, 2015 at 10:59
  • Updated my answer
    – A.B.
    Oct 1, 2015 at 11:51
  • @A.B. E: Version '13.12-1' for 'libwxsmithlib0' was not found (I did apt-get update)
    – R S
    Oct 1, 2015 at 12:16
  • @Zacharee1: by using apt-get remove
    – R S
    Oct 1, 2015 at 12:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .