How to install a specific version of gcc

Hello everyone, pretty simple question, but I feel like I should be doing a bit of sysadmin today and I was wondering how best to install a very specific version of gcc. I have a version on one box and I want the same on another open box. I did gcc -v and this is what came back. So trying to replicate the below configuration to a bare box is a huge task? I know how to do sudo apt-get, is that all that's needed here?

kensey@yadda.com:~/cdev$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
Target: x86_64-linux-gnu

      

Configurable with: ../ src / configure -v --with-pkgversion = 'Ubuntu / Linaro 4.6.3-1ubuntu3' - with-bugurl = file: ///usr/share/doc/gcc-4.6/README. Bugs --enable-languages ​​= c, C ++, fortran, objc, obj-C ++, go --prefix = / usr --program-suffix = -4.6 --enable-shared --enable-linker -build- id --with-system-zlib --libexecdir = / usr / lib --without-included-gettext --enable-threads = posix --with-gxx-include-dir = / usr / include / + + / 4.6 - libdir = / usr / lib --enable-nls --with-sysroot = / - enable-clocale = gnu --enable-libstdcxx-debug --enable-libstdcxx-time = yes --enable-gnu -unique-object --enable-plugin --enable-objc-gc --disable-werror --with-arch-32 = i686 --with-tune = generic --enable- check = release --build = x86_64- linux-gnu - -host = x86_64-linux-gnu --target = x86_64-linux-gnu

Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu3) 

      

TIA!

+2


source to share


1 answer


So this is just the standard Ubuntu 12.04 Precise Penguin GCC release.

Just install the gcc package on a different box with apt-get (assuming it works on 12.04) and you will get the same version.



If 12.04 doesn't work in the other field, but Debian or Ubuntu does work, you can try and add the exact repositories temporarily from /etc/apt/sources.list by installing that version of gcc with apt -get and then deleting the repository. (Not recommended)

+1


source







All Articles