Issue with Redis install "cc: Command not found"
Asked Answered
G

8

33

Installing redis is really easy. I have done it on several VM. But on one instance, I am facing the following problem.

[root@server redis-2.4.2]# make
cd src && make all
make[1]: Entering directory `/home/user/redis-2.4.2/src'
MAKE hiredis
make[2]: Entering directory `/home/user/redis-2.4.2/deps/hiredis'
cc -c -std=c99 -pedantic -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings    -g -ggdb  net.c
make[2]: cc: Command not found
make[2]: *** [net.o] Error 127
make[2]: Leaving directory `/home/user/redis-2.4.2/deps/hiredis'
make[1]: *** [dependencies] Error 2
make[1]: Leaving directory `/home/user/redis-2.4.2/src'
make: *** [all] Error 2

Is there any other way to install redis?

Gittens answered 15/11, 2011 at 3:8 Comment(0)
P
33
make[2]: cc: Command not found

This means that c compiler is uninstalled, or that it's not in $PATH.

Try which cc, this should tell the directory where cc is installed, if it is.

Otherwise, you can use your distro repository to install it.

In Ubuntu: sudo aptitude install build-essential.

Pantheism answered 15/11, 2011 at 15:6 Comment(2)
I am using centos. # No package build-essential available. # how to I install cc ?Gittens
Try yum install gcc first, then try again make for redis.Pantheism
S
90

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

tar xvzf redis-stable.tar.gz

cd redis-stable

sudo apt-get install make

sudo apt-get install gcc

sudo apt-get install tcl

sudo apt-get install build-essential

sudo apt-get update

## if there is another error like "fatal error: jemalloc/jemalloc.h: No such file or directory"

## just run "make distclean"

make

make test

Splenectomy answered 3/9, 2014 at 9:31 Comment(9)
Great stuff, thanks. One thing: you are doing cd redis-stable twice :)Meal
Also, if this were to be a shell script, you should use # for comments.Meal
These steps solved my issues installing on Debian.+1Coping
Every time I install redis, I have to come to this answer :pOakie
Helped me too, on Centos 7.3. Thanks!Gujarat
Works fine in Ubuntu, even within Windows 10. Seems missing make installSoutherner
somebody add these to redis installation page redis.io/downloadLathy
Great writeup, solved some issues I had on Ubuntu 16.04 on EC2Borroff
Wonderful solution given. Thanks a ton. I was getting "fatal error: stdlib.h: No such file or directory #include <stdlib.h>" error while trying to run make command to build redis on my ubuntu 18.04 server. And the "make distclean" solved my issue.Jamijamie
P
33
make[2]: cc: Command not found

This means that c compiler is uninstalled, or that it's not in $PATH.

Try which cc, this should tell the directory where cc is installed, if it is.

Otherwise, you can use your distro repository to install it.

In Ubuntu: sudo aptitude install build-essential.

Pantheism answered 15/11, 2011 at 15:6 Comment(2)
I am using centos. # No package build-essential available. # how to I install cc ?Gittens
Try yum install gcc first, then try again make for redis.Pantheism
T
9

I got myself into similar situation, hope below steps work

make distclean

sudo make

Trebizond answered 4/7, 2017 at 7:23 Comment(1)
This answer made my day :)Papst
I
6

I also use CentOS. You can try this:

$ wget http://download.redis.io/releases/redis-3.0.5.tar.gz
$ tar xzf redis-3.0.5.tar.gz
$ cd redis-3.0.5
$ make MALLOC=libc  && make install
Imes answered 12/11, 2015 at 6:46 Comment(0)
C
1

To install the Redis on Ubuntu, go to terminal and type the following commands:

$sudo apt-get update $sudo apt-get install redis-server

This will install redis on your machine.

To start Redis

$redis-server

Check if redis is working?

$redis-cli

This will open a redis prompt, as shown below:

redis 127.0.0.1:6379>

In the above prompt 127.0.0.1 is your machine's IP address and 6379 is port on which redis server is running. Now type the PING command as shown below.

redis 127.0.0.1:6379> ping

PONG

Cara answered 3/9, 2016 at 9:0 Comment(0)
R
1

(Ubuntu) I tried it with installing with synaptic package manager in ubuntu. Synaptic can be installed using sudo apt-get update sudo apt-get upgrade sudo apt-get install synaptic

ans after installation, just search for redis and install redis-server. It will install redis-client as well.

Redstone answered 7/2, 2017 at 21:9 Comment(0)
Z
0

Steps to Install Redis on Windows 10:

  1. Install linux subsystem through typing "windows features" in windows start:
check the box of windows subsystem for linux
then restart
  1. Install ubunto 22.04 LTS app in microsoft store:
open ubunto app
  1. Add repository by typing:
sudo apt-add-repository ppa:redislabs/redis
  1. Update package manager
sudo apt-get update
  1. Upgrade package manager
sudo apt-get update
  1. Install redis
sudo apt-get install redis-server
Congrats redis is installed!

To confirm version:
redis-server --version

To run redis:

redis-server

Open other ubunto app and connect to local host

redis-cli

Congrats now you can write some cli commands!

Zebulen answered 29/7, 2022 at 11:40 Comment(0)
R
-3

You can try somthing like this :

$ wget http://redis.googlecode.com/files/redis-2.4.2.tar.gz
$ tar xzf redis-2.4.2.tar.gz
$ cd redis-2.4.2
$ make

More info : ( http://redis.io/download )

Refugia answered 15/11, 2011 at 11:12 Comment(1)
this is quite useless, because the root of the error is indicated by the error message and you just change the downloaded file.Alaric

© 2022 - 2024 — McMap. All rights reserved.