Redis - linux / Error when Installing redis on linux: `cc: command not found`
Asked Answered
A

6

25

I wish to install redis on my red-hat environment. I do the following:

wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make 

I got the next error:

make[3]: *** [net.o] Error 127
make[3]: Leaving directory `/tmp/redis-stable/deps/hiredis'
make[2]: *** [hiredis] Error 2
make[2]: Leaving directory `/tmp/redis-stable/deps'
make[1]: [persist-settings] Error 2 (ignored)
    CC adlist.o
/bin/sh: cc: command not found
make[1]: *** [adlist.o] Error 127
make[1]: Leaving directory `/tmp/redis-stable/src'
make: *** [all] Error 2

How can I fix it?

Advertent answered 7/6, 2015 at 10:57 Comment(0)
T
36

You are trying to install redis from source code. What this process do is to compile and create executable on your machine and then install it. For doing this you need various tools like gcc etc. Best way is to install all of them together by installing that group. Run this from terminal

yum grouplist 

This will show all groups available and then choose group you want to install or run directly

yum groupinstall 'Development Tools'

This will save you from other problems which might come in future while installing from source.

Toilsome answered 7/6, 2015 at 11:47 Comment(9)
It gives me the following error: Setting up Group Process Warning: Group Development Tools does not exist. No packages in any requested group available to install or updateAdvertent
@MiddleWare are you able to run this yum install gcc.Toilsome
It gives the following error: Setting up Install Process No package gcc available. Error: Nothing to doAdvertent
You have some issue with your repo then. What is the output of yum repolist .Toilsome
I have the following line: rhel-source Red Hat Enterprise Linux 6Server - x86_64 - Source enabled: 0Advertent
You do not have any repository set in your machine. First add a repo and then only these things will workToilsome
Which repo should I add?Advertent
@MiddleWare sorry for late reply. I think you should install epel repository on your machine. This will consist of all packages(mostly) and will solve your problem. Simple google will help you in installing.Toilsome
If you want to be minimalist: for Redis (as of 5.0.3), yum install gcc is sufficient for the make and yum install tcl is sufficient for the make testMaupin
C
16

for those of you who encounter this error

check this github issue

before make run this command

$ cd deps; make hiredis lua jemalloc linenoise
Clerkly answered 25/10, 2016 at 8:30 Comment(3)
Please, add the error log to the post, don't redirect us using a link.Truc
what are you talking about ? i stated the command as an answer. just run the command before makeClerkly
In my case, I also needed geohash-intKauri
E
5

Install build essential first

sudo apt-get install build-essential

then install the dependencies

cd deps

make hiredis lua jemalloc linenoise

Esprit answered 25/3, 2019 at 7:39 Comment(0)
I
3

If you're not an advanced user maybe it is not a good idea to install REDIS from the source.

Instead you should install a packaged version. For example on Fedora / Centos / RHEL:

sudo yum install redis
Infeasible answered 29/4, 2019 at 15:10 Comment(1)
Underestimated advice !Flying
C
0

Come out from your extracted folder/Dir and remove the extracted redis-x.x.x folder with rm -rf redis-x.x.x

now again extract the redis folder with tar xzf redis-x.x.x.tar.gz

go to redis directory again and run the make or make test again. it works for me.

Casto answered 9/10, 2017 at 7:22 Comment(1)
It would be great if you provide minimal code for all of us, so that it could be better to reproduce on any OS. Thank youUnhelm
A
0

I had the same issue, working with ubi8/ubi-minimal. The make command kept failing until I installed gcc as well:

RUN microdnf -y update \
    && microdnf install -y tar.x86_64 gzip bash make bind-utils gcc  \
    && microdnf clean all

If you look at the redis Dockerfile, you will see that it is used there as well.

Agentive answered 28/2 at 13:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.