redis安装出现的问题

在安装redis之前务必先执行以下命令

sudo apt-get update

在这期间可能会出现些问题:如果在编译的时候报错,则需要先安装make

sudo apt-get install make

如果出现以下的错误

cd src && make all
make[1]: Entering directory '/home/ubuntu/redis-4.0.11/src'
    CC adlist.o
/bin/sh: 1: cc: not found
Makefile:228: recipe for target 'adlist.o' failed
make[1]: *** [adlist.o] Error 127
make[1]: Leaving directory '/home/ubuntu/redis-4.0.11/src'
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 2

则可以安装 gcc

sudo apt-get install gcc

如果报错如下所示

cd src && make all
make[1]: Entering directory '/home/ubuntu/redis-4.0.11/src'
    CC adlist.o
In file included from adlist.c:34:0:
zmalloc.h:50:10: fatal error: jemalloc/jemalloc.h: No such file or directory
 #include <jemalloc/jemalloc.h>
          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:228: recipe for target 'adlist.o' failed
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory '/home/ubuntu/redis-4.0.11/src'
则可以通过

make MALLOC=libc
来替代make命令,即可编译成功
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值