CentOS环境下安装Redis,make时报错?

在CentOS环境中安装Redis时,遇到`make`报错。首先尝试使用`yum`安装必要的依赖,如cpp、binutils等。如果仍然遇到问题,如`cc: command not found`,则需检查并安装c++编译器`gcc-c++`。如果出现`No such file or directory`错误,可能需要执行`make clean`后再进行编译。在某些情况下,删除并重新解压Redis源文件可能是必要的步骤。最终成功安装的标志是看到redis-server和redis-cli文件出现在相应目录。
摘要由CSDN通过智能技术生成
MAKE hiredis
cd hiredis && make static
make[3]: Entering directory `/home/zzb/soft/redis-5.0.3/deps/hiredis'
gcc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings
 -g -ggdb  net.cmake[3]: gcc:命令未找到
make[3]: *** [net.o] 错误 127
make[3]: Leaving directory `/home/zzb/soft/redis-5.0.3/deps/hiredis'
make[2]: *** [hiredis] 错误 2
make[2]: Leaving directory `/home/zzb/soft/redis-5.0.3/deps'
make[1]: [persist-settings] 错误 2 (忽略)
    CC adlist.o
/bin/sh: cc: command not found
make[1]: *** [adlist.o] 错误 127
make[1]: Leaving directory `/home/zzb/soft/redis-5.0.3/src'
make: *** [all] 错误 2
[root@server4 redis-5.0.3]# 
解决方案一:

因为gcc依赖很多,以下按顺序都执行一下:

yum install cpp

yum install binutils

yum install glibc

yum install glibc-kernheaders

yum install glibc-common

yum install glibc-devel

yum install gcc

yum install make
 

然后,删除redis解压文件,重新解压。在执行make。


Hint: It's a good idea to run 'make test' ;)

make[1]: Leaving directory `/home/zzb/soft/redis-4.0.11/src'
[root@server2 redis-4.0.11]# 
[root@server2 src]# ll

......
-rw-rw-r-- 1 root root    2417 8月   4 2018 redisassert.h
-rwxr-xr-x 1 root root 5599902 4月  28 05:31 redis-benchmark
-rw-rw-r-- 1 root root   29605 8月   4 2018 redis-benchmark.c
-rw-r--r-- 1 root root   70320 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值