8

I am trying to install Redis on EC2 but it needs gcc. When I tried gcc was not installed.

Then I tried to install gcc manually and got the following error:

configure: error: could not find a working compiler, see config.log for details

How can I solve this?

akshay hundia
  • 249
  • 1
  • 5
  • 12

2 Answers2

28

If you use a standard AMI Linux instance, you can install gcc simply by running:

sudo yum groupinstall "Development Tools"

On a SuSE instance, you can try:

sudo zypper install gcc
Didier Spezia
  • 70,911
  • 12
  • 189
  • 154
1

I copied form user7706975's answer

1 Download gcc version from gcc.parentingamerica.com/releases.

2 Compile it from Gcc Wiki for example if you want the version 4.6.2

tar xzf gcc-4.6.2.tar.gz
cd gcc-4.6.2
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-4.6.2/configure --prefix=$HOME/GCC-4.6.2 --enable-languages=c,c++,fortran,go
make
make install

Reference: My AWS EC2 Instance: Ubuntu 16.04

Community
  • 1
  • 1
Cloud Cho
  • 1,594
  • 19
  • 22