当我尝试安装 build-essential 时,如何解决该错误?

当我尝试安装 build-essential 时,如何解决该错误?

我无法在笔记本电脑上安装 build-essential:

显示错误:

The following packages have unmet dependencies:
build-essential : Depends: g++ (>= 4:4.4.3) but it is not going to be installed
Depends: dpkg-dev (>= 1.13.5) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

答案1

在未满足的依赖关系列表的最后,你可能发现它列出了这个花絮

Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

尝试在命令行中输入以下内容

sudo apt-get -f install

然后它会提示你将要安装的软件包

Do you want to continue [Y/n]?

之后你应该能够继续前进

sudo apt-get install build-essential

答案2

build-essentials 是编译 debian 软件包所需的所有软件包的参考。它通常包括 gcc/g++ 编译器、库和一些其他实用程序。查看文档这里

要安装构建必需品,只需按键盘上的Ctrl+ Alt+T打开终端。打开后,运行以下命令:

sudo apt-get install build-essential libxslt1.1 libxslt1-dev libxml2 ruby-full mysql-server libmysqlclient-dev libmysql-ruby libssl-dev libopenssl-ruby libcurl4-openssl-dev imagemagick libmagickwand-dev git-core redis-server libffi-dev libffi-ruby rubygems libsqlite3-dev libpq-dev libreadline5 openjdk-7-jre nodejs libncurses5-dev openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libyaml-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libgdbm-dev ncurses-dev automake libtool bison subversion pkg-config

来源:Diaspora Project

答案3

以下软件包具有未满足的依赖项:build-essential:依赖:g++(>= 4:4.4.3)但不会安装依赖:dpkg-dev(>= 1.13.5)但不会安装此错误是由源列表中的错误引起的,您需要编辑此文件:

    root@debian:~# nano /etc/apt/sources.list

删除冲突源然后添加此行:

    deb http://ftp.debian.org/debian/ stable main contrib non-free 

然后:

    root@debian:~# apt-get update

    root@debian:~# apt-cache search build-essential --names-only 

    build-essential - Informational list of build-essential packages

    root@debian:~# sudo apt-get install build-essential

就这些了...问候...

访问http://forums.debian.net/viewtopic.php?f=30&t=84184

相关内容