Codeblocks 安装

Codeblocks 安装

我已尝试按照以下说明安装代码块:

http://wiki.codeblocks.org/index.php/Installing_Code::Blocks_nightly_build_on_Ubuntu

但最后还是做错了。

woelrat@ubuntu:~$ dpkg -l | grep codeb
ii  codeblocks 13.12-3 amd64        Code::Blocks integrated development environment (IDE)
ii  codeblocks-common                                     13.12-3                                             all          common files for Code::Blocks IDE
iU  codeblocks-contrib-dbg                                13.12-3                                             amd64        dummy transitional package for Code::Blocks debugging symbols
iU  codeblocks-dbg                                        13.12-3                                             amd64        Code::Blocks debugging libraries
ii  codeblocks-dev                                        13.12-1                                             amd64        Code::Blocks development libraries (SDK)
ri  codeblocks-headers                                    13.12-1                                             all          Code::Blocks development headers (SDK)
ri  codeblocks-libwxcontrib0                              13.12-1                                             amd64        Code::Blocks shared libraries for wxContribItems
ri  codeblocks-wxcontrib-dev                              13.12-1                                             amd64        Code::Blocks development libraries for wxContribItems
ii  codeblocks-wxcontrib-headers                          13.12-1                                             all          Code::Blocks development headers for wxContribItems
ii  libcodeblocks0                                        13.12-1                                             amd64        Code::Blocks shared libraries

我已经尝试过sudo apt-get -f install以下错误:

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)

The following packages have unmet dependencies:

codeblocks-dbg : Depends: codeblocks-contrib (= 13.12-3) but it is not going to be installed

codeblocks-headers : Depends: codeblocks-dev (>= 13.12-1) but it is not going to be installed
                  Depends: codeblocks-dev (< 13.12-1.1~) but it is not going to be installed

libwxsmithlib0 : Depends: libcodeblocks0 (= 13.12-3) but 13.12-1 is to be installed
              Recommends: codeblocks-contrib (= 13.12-3) but it is not going 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 install libwxsmithlib0 libwxsmithlib0-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libwxsmithlib0 is already the newest version.
libwxsmithlib0-dev is already the newest version.
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
 libwxsmithlib0 : Depends: libcodeblocks0 (= 13.12-3) but 13.12-1 is to be installed
                  Recommends: codeblocks-contrib (= 13.12-3) but it is not going 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).

我仍然有依赖关系问题。有人知道如何解决这个问题吗?

答案1

@woelrat 谢谢你的回复。我刚刚解决了同样的问题。

脚步:

  • 列出所有与 codeblocks 相关的数据包

    dpkg --list | grep -i codeblocks
    
  • 然后删除具有未满足依赖关系的软件包

    sudo dpkg --purge codeblocks-dev
    sudo apt-get update && sudo apt-get upgrade && sudo apt-get -f install
    

瞧瞧。

可能是你的软件中心因为某些故障崩溃了。建议你重新安装

sudo apt-get remove -f software-center && sudo apt-get install -f software-center

现在您可以使用软件中心安装稳定版本的 codeblocks。

答案2

我单独删除了所有包裹。(你需要找出正确的顺序!)

sudo dpkg -i packages-name.deb

需要强制删除其中一个包(依赖关系在树包之间循环)

使用 ubuntu 软件管理器安装了 codeblocks。这在 5 分钟内就完成了 :-)

答案3

尝试:

sudo apt purge codeblocks*

这将删除与 codeblocks 相关的所有文件。然后尝试:

sudo apt -f install

sudo apt autoremove

您的问题将得到解决,并从 Ubuntu 软件中安装它,以便于安装。

相关内容