Download the Deb installation package in Ubuntu and install GCC in earlier versions

Source: Internet
Author: User

From: http://hi.baidu.com/419836321/blog/item/690ba4a5bbc597ef9152ee26.html

Http://gcc.gnu.org/

To compile the software, the gcc4.4.1 version of Ubuntu is too high and gcc3.x is required. Therefore, you need to install GCC of the lower version. I chose gcc3.4.4.
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:
Gcc-3.4-base_3.4.6-6ubuntu3_i386.deb,
Gcc-3.4_3.4.6-6ubuntu3_i386.deb,
Cpp-3.4_3.4.6-6ubuntu3_i386.deb,
G ++-3.4 _ 3.4.6-6ubuntu3_i386.deb,
Libstdc ++ 6-dev_3.4.6-6ubuntu3_i386.deb
For: http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-3.4/

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.4.4.
Third, system configuration
After the installation is complete, more: gcc-3.4 will be available in the system
Currently, there are two versions of GCC in the system, which are short of gcc4.4.1. You need to change the default configuration of the system:
Check the GCC versions currently installed.

Ls/usr/bin/GCC *-ll

Rwxrwxrwx 1 Root 21/usr/bin/GCC->/etc/alternatives/GCC

-Rwxr-XR-x 1 Root 85552/usr/bin/gcc-3.4

-Rwxr-XR-x 1 Root 193372/usr/bin/gcc-4.2

-Rwxr-XR-x 1 Root 16090/usr/bin/gccbug-3.4

-Rwxr-XR-x 1 Root 2018/usr/bin/gccmakedep

Added gcc3.4.6 and gcc4.3.2 options
$ Sudo Update-alternatives -- install/usr/bin/GCC gcc/usr/bin/gcc-4.2 40

$ Sudo Update-alternatives -- install/usr/bin/GCC gcc/usr/bin/gcc-3.4 30

Switch version to gcc-3.4

$ Sudo Update-alternatives -- config gcc

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

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

2/usr/bin/gcc-4.2

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

Use '/usr/bin/gcc-3.4' to provide 'GCC ".

 

So far, gcc3.4.4 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 ++

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.