Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm having some trouble with dependencies it seems, but myself don't really know how to resolve the issue. Here's the output:

~:) sudo apt-get install build-essential
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
  build-essential: Depends: g++ (>= 4:4.3.1) but 4:4.2.3-1ubuntu6 is to be installed
E: Broken packages
~:) sudo apt-get install g++
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
  g++: Depends: cpp (>= 4:4.3.1-1ubuntu2) but 4:4.2.3-1ubuntu6 is to be installed
       Depends: gcc (>= 4:4.3.1-1ubuntu2) but 4:4.2.3-1ubuntu6 is to be installed
       Depends: g++-4.3 (>= 4.3.1-1) but it is not going to be installed
       Depends: gcc-4.3 (>= 4.3.1-1) but it is not installable
E: Broken packages
~:)

Edit: I just tried aptitude instead of apt-get, as suggested. Doesn't work, had other problems:

~:) sudo aptitude install build-essential
[sudo] password for ehsanul: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Reading extended state information      
Initializing package states... Done
Building tag database... Done      
The following packages are BROKEN:
  g++ g++-4.3 libstdc++6-4.3-dev 
The following packages have been automatically kept back:
  dpkg-dev fakeroot libdns35 libisc35 linux-libc-dev patch 
The following NEW packages will be automatically installed:
  libgmp3c2 libmpfr1ldbl 
The following packages have been kept back:
  adobe-flashplugin bind9-host dnsutils gvfs gvfs-backends gvfs-fuse 
  libatm1 libbind9-30 libgvfscommon0 libisccc30 libisccfg30 liblwres30 
  libnautilus-extension1 linux-headers-2.6.24-24 
  linux-headers-2.6.24-24-generic linux-image-2.6.24-24-generic nautilus 
  nautilus-data 
The following NEW packages will be installed:
  libgmp3c2 libmpfr1ldbl 
The following packages will be upgraded:
  build-essential 
The following partially installed packages will be configured:
  timidity 
2 packages upgraded, 4 newly installed, 0 to remove and 24 not upgraded.
Need to get 775kB/6265kB of archives. After unpacking 20.3MB will be used.
The following packages have unmet dependencies:
  libstdc++6-4.3-dev: Depends: gcc-4.3-base (= 4.3.2-1ubuntu11) which is a virtual package.
                      Depends: libstdc++6 (>= 4.3.2-1ubuntu11) but 4.2.4-1ubuntu4 is installed.
  g++-4.3: Depends: gcc-4.3-base (= 4.3.2-1ubuntu11) which is a virtual package.
           Depends: gcc-4.3 (= 4.3.2-1ubuntu11) which is a virtual package.
           Depends: libc6 (>= 2.8~20080505) but 2.7-10ubuntu4 is installed.
  g++: Depends: cpp (>= 4:4.3.1-1ubuntu2) but 4:4.2.3-1ubuntu6 is installed.
       Depends: gcc (>= 4:4.3.1-1ubuntu2) but 4:4.2.3-1ubuntu6 is installed.
       Depends: gcc-4.3 (>= 4.3.1-1) which is a virtual package.
Resolving dependencies...
The following actions will resolve these dependencies:

Keep the following packages at their current version:
build-essential [11.3ubuntu1 (hardy, now)]
g++ [4:4.2.3-1ubuntu6 (hardy-updates, now)]
g++-4.3 [Not Installed]
libstdc++6-4.3-dev [Not Installed]

Score is -9852

Accept this solution? [Y/n/q/?]
share|improve this question

5 Answers 5

up vote 3 down vote accepted

Looks like messed up repositories for me. Ubuntu 8.04 LTS does not have GCC 4.3.x, only 4.2.x, and it had not been back ported. Try inspecting /etc/apt/sources.list to find any non hardy repositories laying around.

share|improve this answer

Try using aptitude instead, it can be a little smarter in handling package dependencies.

sudo aptitude update && aptitude install build-essential

update

I did some googling and found that the above solution worked for at least one other person that was having the same problem. (see bottom of thread)

Link: http://ubuntuforums.org/showthread.php?t=940314

share|improve this answer
    
Thanks, but I tried this before, and it suggests leaving everything in their current versions as a way to resolve dependencies -- The following actions will resolve these dependencies: Keep the following packages at their current version: build-essential [11.3ubuntu1 (hardy, now)] g++ [4:4.2.3-1ubuntu6 (hardy-updates, now)] g++-4.3 [Not Installed] libstdc++6-4.3-dev [Not Installed] –  ehsanul Jul 31 '09 at 0:33
    
hmm, very strange. Maybe try 'aptitude purge build-essential' and then 'aptitude install libc6-dev' (or libc6-dev-amd64 if an amd64 system) and then run 'sudo aptitude update && aptitude install build-essential' again. Also make sure that your system is completely up to date with 'aptitude full-upgrade', that can make a difference as well. –  faultyserver Jul 31 '09 at 1:04
1  
+1 aptitude handled the dependencies correctly and even removed the packages that were creating the trouble. I would recommend trying this too,, –  ashishsony Aug 6 '12 at 10:50

I second the /etc/apt/sources.list suggestion. Can you post yours? My first guess is that something is broken there.

share|improve this answer

Had this problem too. I discovered that I messed up both my /etc/apt/sources.list and /etc/apt/preferences. Fixing those files did the trick.

share|improve this answer

I don't run any 8.04 boxes any more but it looks like you need to have gcc-4.3 installed before it will let you proceed. Do you get any results from "apt-cache search gcc-4.3" or "sudo apt-get install gcc-4.3"?

What does your /etc/apt/sources.list and /etc/apt/sources.list.d/* files contain? Do you have universe or multiverse as well as main listed? Do you have the backports repo enabled as well?

Taking a quick look through a few of the Package.gz files for hardy I didn't see anything for gcc-4.3 but I didn't look too far because I don't know which repos and dists you are using.

Good luck

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.