I need to install a GEOS version >= 3.2.2, and doing so is beyond my current aptitude (pun intended).

The current Debian squeeze version is 3.2.0, which will not work for my purposes (using the rgeos package in R).

I've tried the following:

  • Installing the 3.3.3 package from the Debian wheezy repository via dpkg -i
  • Installing several 3.2.2 packages from the Ubuntu repository.

All fail because I need libstdc++6 (>=4.6) and I have version 4.4.5-8.

I assume that what I need is to install a newer libstdc++6, but I want to do so in a way that doesn't break existing packages. Is it possible to have two versions installed at once, with the newer one being used only for GEOS? And if so, how do I do that.


As per @Marco's suggestion, I've compiled GEOS and it compiles/installs properly but with both 3.3.3 and 3.2.3 I get the following error when I try installing the rgeos package in R:

* installing *source* package ‘rgeos’ ...
** package ‘rgeos’ successfully unpacked and MD5 sums checked
checking geos-config usability... yes
configure: geos-config: geos-config
configure: GEOS version: 3.2.3
checking geos version over 3.2.1... yes
checking geos-config clibs... no
checking for gcc... gcc -std=gnu99
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
  • Probably an easier and safer way is to take the sources for 3.3.3 and compile your own backport. This links to the older libraries instead of the new ones. However, this does not always succeed.
    – Marco
    Oct 7 '12 at 12:48
  • @Marco That's a good point. GEOS says it simply requires gcc 4.x , so I'm working on building from sources. Is there a recommended procedure for backporting other than just building in the usual way (make/configure/install)? Oct 7 '12 at 15:28
  • You can do a configure/make/make install installation. But creating a debian package would be a better solution. The instructions were too long for a comment, so I posted that as an answer.
    – Marco
    Oct 7 '12 at 15:48

Probably an easier and safer way is to take the sources for 3.3.3 and compile your own backport. This links to the older libraries instead of the new ones. It might fail in cases the package depends on functionality only present in the newer version.

Obtain the sources

To create a backport, add the repositories to your sources.list of the version you want to compile. You also need the deb-src entries. Run apt-get update to update the database. Don't forget to restore it after you're done.

The sources can be pulled with apt-get source libgeos-3.3.3. Or you can retrieve the source packages from Debian manually. You extract the source with dpkg-source -x libgeos-3.3.3.dsc.

Retrieve dependencies

To install all packages that depend on the build, run

apt-get build-dep libgeos-3.3.3

Compile the source and create package

If necessary you can adjust the compile options in the file debian/rules. To create a Debian package run

dpkg-buildpackage -rfakeroot -b -us -uc

You end up with a normal package that can be installed and removed using your package manager. Install it with dpkg -i package.

  • This is great, thanks. If I add the wheezy repository to sources.list, though, won't all my packages update to the testing versions? Oct 7 '12 at 20:24
  • Not if you only add the wheezy source repositories. Or you can add the binary repos but configure apt to use squeeze by default by adding APT::Default-Release "squeeze"; to /etc/apt/apt.conf or to a file in /etc/apt/apt.conf.d/
    – cas
    Oct 7 '12 at 21:26
  • @CraigSanders Setting a default release won't help you if you try to install something from Wheezy that depends on something important from Wheezy, such as libc.
    – jordanm
    Oct 7 '12 at 22:51
  • 1
    Versioned dependency resolution is a feature, not a bug. BTW, more fine-grained control over what apt installs can be achieved with apt's pinning feature...but setting the default release is good enough for many use-cases.
    – cas
    Oct 7 '12 at 22:59
  • It might be easier to just manually download the source package. Especially because you mentioned there were not many dependencies.
    – Marco
    Oct 8 '12 at 6:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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