Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to install the library libg2c0, which is required for the package xfoil. However this package is unavailable at ubuntu 12.04. I tried the suggestions from

sudo nano /etc/apt/sources.list

I added the following lines at the end of the file:

deb hardy main universe 
deb-src hardy main 
deb hardy-updates main universe 
deb-src hardy-updates main universe

Update the list and install the library:

sudo apt-get update
sudo apt-get install libg2c0

When these commands are executed I get the error:

The following packages have unmet dependencies:
 libg2c0 : Depends: gcc-3.4-base (= 3.4.6-6ubuntu5) but it is not going to be installed

Additionally I tried to install the package from UbuntuPackages, but this did not work either.

I hope you can give me some hints about how to solve this problem. Would be really appreciated.

share|improve this question

It seems for me you have some package pinnings.

dpkg way

But either way, just download those packages (libg2c0, gcc-3.4-base, gcc-3.4, cpp-3.4) with wget and install them directly with dpkg. With some command line fu:

PACKAGES=(libg2c0 gcc-3.4 gcc-3.4-base cpp-3.4)
for pkg in $PACKAGES; do wget${pkg}_3.4.6-6ubuntu5_$(dpkg --print-architecture).deb; done
sudo dpkg -i ${PACKAGES/%/_3.4.6-6ubuntu5_$(dpkg --print-architecture).deb}

There is no need for the hardy package sources with this method.

APT way

An alternate method with the hardy sources enabled would be to set up some package pinnings in /etc/apt/preferences:

Package: libg2c0 gcc-3.4 gcc-3.4-base cpp-3.4
Pin: release a=hardy*
Pin-Priority: 500

Package: *
Pin: release a=hardy*
Pin-Priority: -1
share|improve this answer

Your Answer


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.