How to install GCC of earlier versions under Ubuntu10.10

Source: Internet
Author: User

For software compilation, the gcc4.4.5 version of Ubuntu 10.10 LTS is too high and gcc3.x is required. Therefore, you need to install gcc of lower version. I chose gcc3.3.6.
1. Download the deb installation package. If I select the source code package for compilation and installation, an error will occur. Therefore, select deb package for installation. The package I downloaded is:
Cpp-3.3_3.3.6-15ubuntu6_i386.deb
Gcc-3.3_3.3.6-15ubuntu6_i386.deb
Gcc-3.3-base_3.3.6-15ubuntu6_i386.deb
Libstdc ++ 5-3.3-dev_3.3.6-15ubuntu6_i386.deb
For: http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-3.3/

Force installation: sudo dpkg -- force-depends-I xxx. deb

2. install these packages in sequence. I first install the gcc package, and then install the package first and then install gcc3.3.6.
Third, system configuration
After the installation is complete, more: gcc-3.3 will be available in the system
Currently, there are two versions of gcc in the system, which are short of gcc4.4.3. You need to change the default configuration of the system:
Check the gcc versions currently installed.

Ls/usr/bin/gcc *-ll

Lrwxrwxrwx 1 root 7 2010-08-09/usr/bin/gcc-> gcc-4.4
-Rwxr-xr-x 1 root 80916/usr/bin/gcc-3.3
-Rwxr-xr-x 1 root 220428 2010-03-27 06:46/usr/bin/gcc-4.4
-Rwxr-xr-x 1 root 15970/usr/bin/gccbug-3.3

Added gcc3.3.6 and gcc4.4.3 options
$ Sudo update-alternatives -- install/usr/bin/gcc/usr/bin/gcc-4.4 1

$ Sudo update-alternatives -- install/usr/bin/gcc/usr/bin/gcc-3.3 2

Switch version to gcc-3.3

. 1) Simple and Convenient

Ln-sf/usr/bin/gcc-3.3/usr/bin/gcc

. 2) troublesome and difficult to use

$ Sudo update-alternatives -- config gcc

There are two options available, both of which provide "gcc"

<Select option --------------------------------------------------- 1/usr/bin/gcc-3.3 * +

2/usr/bin/gcc-4.4

To maintain the default value [*], press the Enter key or enter the selected number: 1.

Use '/usr/bin/gcc-3.3' to provide 'gcc ".

 

So far, gcc3.3.6 is successfully installed.

============================

After completion, you will find that the system cannot find g ++, so you have to install g ++ yourself:

Sudo apt-get install g ++

// G ++ does not disappear after I install it in ubuntu ..

Reprinted: http://blogold.chinaunix.net/u/1676/showart_2295069.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.