ubuntu安装redis以及报错处理

ubuntu安装redis以及报错处理

报错一、gcc问题

root@ric85:/data/working/redis-stable# make
cd src && make all
make[1]: 进入目录“/data/working/redis-stable/src”
    CC Makefile.dep
    CC adlist.o
adlist.c:32:10: fatal error: stdlib.h: 没有那个文件或目录
   32 | #include <stdlib.h>
      |          ^~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:403:adlist.o] 错误 1
make[1]: 离开目录“/data/working/redis-stable/src”
make: *** [Makefile:6:all] 错误 2

解决:

可以在命令行输入如下的命令进行安装:
sudo apt-get install  build-essential
也可以单个包进行安装,如:
sudo apt-get install libc6-dev

下面是安装过程

root@ric85:/data/working/redis-stable/src# apt install build-essential
正在读取软件包列表... 完成
...
...
下列软件包有未满足的依赖关系:
 build-essential : 依赖: libc6-dev 但是它将不会被安装 或
                           libc-dev
                   依赖: g++ (>= 4:9.2) 但是它将不会被安装
E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。
root@ric85:/data/working/redis-stable/src# apt-get install --reinstall libc6=2.31-0ubuntu9.7
正在读取软件包列表... 完成
...
...
您希望继续执行吗? [Y/n] y
...
...
正在处理用于 man-db (2.9.1-1) 的触发器 ...

root@ric85:/data/working/redis-stable/src# apt-get install libc6-dev
正在读取软件包列表... 完成
...
...
您希望继续执行吗? [Y/n] y
...
...
正在处理用于 man-db (2.9.1-1) 的触发器 ...

root@ric85:/data/working/redis-stable# apt install build-essential
正在读取软件包列表... 完成
...
...
您希望继续执行吗? [Y/n] y
...
...
正在处理用于 libc-bin (2.31-0ubuntu9.9) 的触发器 ...

错误二、

root@ric85:/data/working/redis-stable# make
cd src && make all
make[1]: 进入目录“/data/working/redis-stable/src”
    CC adlist.o
In file included from adlist.c:34:
zmalloc.h:50:10: fatal error: jemalloc/jemalloc.h: 没有那个文件或目录
   50 | #include <jemalloc/jemalloc.h>
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:403:adlist.o] 错误 1
make[1]: 离开目录“/data/working/redis-stable/src”
make: *** [Makefile:6:all] 错误 2

解决:

使用如下命令
root@ric85:/data/working/redis-stable# make MALLOC=libc

猜你喜欢

转载自blog.csdn.net/fhw925464207/article/details/132079962
今日推荐