0

I recently tried to install code:blocks using the 64 bit binary from this link, and it was apparently the worst thing in the world I could have done to my machine. I ended up not able to install the program using that package and it ended up not able to install any of the deb packages in the tar file at all because dependencies weren't being met. Now my system won't install software using the apt-get command because it sends this error due to codeblocks dependency errors.

 The following packages have unmet dependencies:
codeblocks-contrib : Depends: libwxsmithlib0 (= 13.12-1) but 13.12-3 is installed
                  Depends: codeblocks (= 13.12-1) but 13.12-3 is installed
                  Recommends: valgrind but it is not installed
                  Recommends: cppcheck but it is not installed
                  Recommends: cscope but it is not installed
                  Recommends: cccc but it is not installed
codeblocks-dbg : Depends: codeblocks-contrib (= 13.12-3) but 13.12-1 is installed
codeblocks-dev : Depends: libcodeblocks0 (= 13.12-1) but 13.12-3 is installed
              Depends: codeblocks-headers (= 13.12-1) but it is not installable
E: Unmet dependencies. Try using -f.

When I try to use sudo apt-get install -f I get the following output

$ 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 codeblocks-dev
Recommended packages:
valgrind
The following packages will be upgraded:
codeblocks-contrib codeblocks-dev
2 upgraded, 0 newly installed, 0 to remove and 43 not upgraded.
4 not fully installed or removed.
Need to get 0 B/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
(Reading database ... 244536 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)

From the errors, it seems to me like the problem is that apt-get install -f is trying to use a different version than what the deb files installed, so it isn't resolving the dependency problem or something like that. Does this seem like it's the source of my problem with the apt-get command working? If not, what else could the problem be? I've tried using apt-get clean and autoclean, and others.

  • change software source to main server @Paul and try update again – Ravan Aug 31 '15 at 05:52
  • @Ravan, do you mean change the package resources in the package manager? Are you saying I should uncheck one of the options or something? Could you be more specific? If you're saying that I should run `sudo apt-get install codeblocks` through terminal, the terminal just returns the same dependency error and suggests `sudo apt-get install -f` – Paul Ronquillo Aug 31 '15 at 06:13
  • follow my answer [here](http://askubuntu.com/questions/661216/unable-to-install-samba-on-ubuntu-14-04) @Paul – Ravan Aug 31 '15 at 06:18
  • @Ravan, this solution didn't work for me. The says only one thing is left with dependency problems, which is codeblocks-dbg – Paul Ronquillo Aug 31 '15 at 06:30
  • Is there any change in your error....if there please edit your question – Ravan Aug 31 '15 at 06:31
  • refer [here](http://askubuntu.com/questions/140246/how-do-i-resolve-unmet-dependencies-after-adding-a-ppa)... – Ravan Aug 31 '15 at 06:36

1 Answers1

0

I just figured out how to solve the problem in my case. I don't know if this is best practice or not, but I basically kept trying to run sudo apt-get remove codeblocks to get an error code and see which components of codeblocks were installed and had dependency errors. I then used sudo dpkg -r --force-depends <package name> where I replaced with whatever package that seemed to be causing an issue. I ended up having to do this to codeblocks-dev, codeblocks-contrib, and codeblocks-dbg which was from the first set of error codes I have.

Again, I'm not sure if this is the proper way to do this, but after doing this, I was then able to install non-codeblocks packages again, which works for me.