Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

Can I build packages for Debian 5.0 using Debian 6.0 or Debian Wheezy?

I assume that I could do a complete chroot'ed installation of Debian 5.0 and do my builds there, but it might be nice to have something lighter-weight.

For bonus points - can I build packages for Debian 5.0 using the version of g++ from Debian 6.0 or Debian Wheezy? I'm responsible for developing some Debian 5.0 software, but I'd like to start using C++11 features that aren't available in Debian 5.0's g++.

share|improve this question
A chroot is exactly what Debian developers use in this circumstance. Debian comes with several tools to make this very easy. – Gilles Mar 2 '12 at 0:48
Here is a patch for backporting 4.7 to stable. It isn't what you were asking, but will give you an idea what is involved. See Get newest gcc for debian – Faheem Mitha May 26 '12 at 3:42
up vote 2 down vote accepted

You might find the schroot or pbuilder packages convenient for this, since they are designed to maintain a build environment for multiple versions of Debian.

That said, a basic chroot is a couple of hundred MB in size; you could have thousands of them on most modern systems without really noticing. debootstrap is a great tool for getting those working swiftly.

Building with a newer version of G++ is traditionally exciting, because the support libraries also need to change - and so the older glibc release may not support your newer binary code well.

You should be able to backport the appropriate version of G++ and have it work, but directly using the newer version might cause problems. The release notes should help understand that.

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.