How to install a specific version of gcc
Hi all rather a basic question but it appears I have to do a bit of sysadmin today, and I was wondering the best way to install a very specific version of gcc. I have a version on one box and I want the same on another bare box. I did a gcc -v and this is what came back. So is trying to replicate the below configuration on a bare box - is this a huge task? I know how to do sudo apt-get, is that all that is necessary 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
Configured 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/c++/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- checking=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!
So this is just the stock standard Ubuntu 12.04 Precise Penguin GCC version.
Just install the gcc package on the other box with apt-get (assuming it is running 12.04), and you'll get the same version.
If the other box is not running 12.04 but is running Debian or Ubuntu, you can try and add the precise repositories from /etc/apt/sources.list temporarily, installing this gcc version with apt-get, then removing the repository. (Not recommended)
链接地址: http://www.djcxy.com/p/86912.html上一篇: 编译到Raspberry Pi,使用Qt和opencv
下一篇: 如何安装特定版本的gcc