redis 编译安装错误问题

时间:2021-03-18 04:55:00

编译redis安装的时候报错如下:

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 `/etc/yum.repos.d/redis-4.0.1/src'
make: *** [all] Error 2
[root@localhost redis-4.0.1]# make
cd src && make all
make[1]: Entering directory `/etc/yum.repos.d/redis-4.0.1/src'
CC Makefile.dep
make[1]: Leaving directory `/etc/yum.repos.d/redis-4.0.1/src'
make[1]: Entering directory `/etc/yum.repos.d/redis-4.0.1/src'
CC adlist.o
/bin/sh: cc: command not found
make[1]: *** [adlist.o] Error 127
make[1]: Leaving directory `/etc/yum.repos.d/redis-4.0.1/src'
make: *** [all] Error 2
[root@localhost redis-4.0.1]# make
cd src && make all
make[1]: Entering directory `/etc/yum.repos.d/redis-4.0.1/src'
CC adlist.o
/bin/sh: cc: command not found
make[1]: *** [adlist.o] Error 127
make[1]: Leaving directory `/etc/yum.repos.d/redis-4.0.1/src'
make: *** [all] Error 2

 

解决:

1./bin/sh: cc: command not found   错误是因为一些依赖包未安装

yum -y install gcc gcc-c++ libstdc++-devel   解决

2.zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h:

make MALLOC=libc  解决