2

I can't install build-essential on my laptop :

It shows error:

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.
Tim
  • 32,861
  • 27
  • 118
  • 178
Jack
  • 121
  • 1
  • 1
  • 3
  • sudo apt-get install -f – Qasim May 23 '13 at 16:01
  • Welcome to Ask Ubuntu! It is preferred if you can post separate questions instead of combining your questions into one. That way, it helps the people answering your question and also others hunting for atleast one of your questions. And ranting here will not get your problem solved. Thanks! – guntbert May 23 '13 at 16:32
  • Not an answer, but for the record, you might end up in this situation when you interrupt an upgrade. – Andrea Corbellini Aug 24 '16 at 22:40

3 Answers3

2

At the very end of that list of unmet dependencies you may find that it lists this tidbit

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

Try typing the following into the command line

sudo apt-get -f install

It should then prompt you with the packages it will be installing together with

Do you want to continue [Y/n]?

you should be able to move forward after that with

sudo apt-get install build-essential
Marc
  • 123
-1

The build-essentials is a reference for all the packages needed to compile a debian package. It generally includes the gcc/g++ compilers an libraries and some other utils. Check the documentation Here

To install build essentials, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

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

Source:Diaspora Project

Mitch
  • 107,631
  • 1
    Can you explain why that many packages need to be installed manually? Build-essential used to depend on everything it needed. – guntbert May 23 '13 at 16:34
-3

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 This error is caused by error in your source list, you need edit this file:

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

Remove conflict sources and then add this line:

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

then:

    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

that's all...regards...

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