当前位置: 首页 > article >正文

ubuntu、linux安装redis(使用tar包的方式)

目录

1、准备redis的tar包

2、执行make

3、执行make install

4、运行redis

5、总结


1、准备redis的tar包

        去官网或者github上下载对应的tar包,我下载的是 redis-6.2.14.tar.gz

        上传到ubuntu后,使用指令进行解压:

tar -xvf redis-6.2.14.tar.gz

        然后进行到解压目录内。

2、执行make

        执行make指令,由于我的系统是新安装的镜像报错,没有make指令,因此安装make指令:

        报错信息:

cd src && make all
make[1]: Entering directory '/home/ipp/redis-6.2.14/src'
    CC Makefile.dep
    CC adlist.o
/bin/sh: 1: cc: not found
make[1]: *** [Makefile:376: adlist.o] Error 127
make[1]: Leaving directory '/home/ipp/redis-6.2.14/src'
make: *** [Makefile:6: all] Error 2
root@ubuntu:/home/ipp/redis-6.2.14# make install
cd src && make install
make[1]: Entering directory '/home/ipp/redis-6.2.14/src'
    CC adlist.o
/bin/sh: 1: cc: not found
make[1]: *** [Makefile:376: adlist.o] Error 127
make[1]: Leaving directory '/home/ipp/redis-6.2.14/src'
make: *** [Makefile:9: install] Error 2

        安装完make即可,指令:

apt install make

3、执行make install

        如果执行make install 指令。此时还报错:

MAKE hiredis
cd hiredis && make static 
make[3]: Entering directory '/home/ipp/redis-6.2.14/deps/hiredis'
cc -std=c99 -pedantic -c -O3 -fPIC   -Wall -W -Wstrict-prototypes -Wwrite-strings -Wno-missing-field-initializers -g -ggdb alloc.c
make[3]: cc: Command not found
make[3]: *** [Makefile:228: alloc.o] Error 127
make[3]: Leaving directory '/home/ipp/redis-6.2.14/deps/hiredis'
make[2]: *** [Makefile:53: hiredis] Error 2
make[2]: Leaving directory '/home/ipp/redis-6.2.14/deps'
make[1]: [Makefile:328: persist-settings] Error 2 (ignored)
    CC adlist.o
/bin/sh: 1: cc: not found
make[1]: *** [Makefile:376: adlist.o] Error 127
make[1]: Leaving directory '/home/ipp/redis-6.2.14/src'
make: *** [Makefile:6: all] Error 2

        说明缺少gcc,安装gcc

apt install gcc 

        再去执行在redis的安装目录下执行

make install

        如果执行以上指令报错没有xxxxx.h文件,那么就rm -rf删除redis的解压目录,然后重新解压,然后make install 

4、运行redis

        在解压目录下找到redis.conf文件,将内容里面的

daemonize no 改成 daemonize yes

        然后进入到src下执行

./redis-server ../redis.conf

        验证是否启动成功

ps -ef|grep redis

        得到下面的提示就表示成功了。

5、总结

        按照步骤一步步来,你是可以的,每天给自己打个气,加油!

        所有的困难都是一步步解决的,即使当前你干的工作比较难,只要用心,最后都能解决,加油,对面的你!

学习之所以会想睡觉,是因为那是梦开始的地方。
ଘ(੭ˊᵕˋ)੭ (开心) ଘ(੭ˊᵕˋ)੭ (开心)ଘ(੭ˊᵕˋ)੭ (开心)ଘ(੭ˊᵕˋ)੭ (开心)ଘ(੭ˊᵕˋ)੭ (开心)
                                                                                                        ------不写代码不会凸的小刘


http://www.kler.cn/news/317064.html

相关文章:

  • 前端——实现时钟 附带小例子
  • 数据结构:线性表
  • 2024从传统到智能,AI做PPT软件的崛起之路
  • 【文心智能体】 旅游手绘手帐 开发分享 零代码 手绘风景 记录行程和心情 旅游攻略
  • 鹏哥C语言49---第5次作业:选择语句 if 和 switch
  • 脚本注入网页:XSS
  • springboot中的异步任务
  • Matplotlib-数据可视化详解
  • 瑞芯微RK3588开发板Linux系统添加自启动命令的方法,深圳触觉智能Arm嵌入式鸿蒙硬件方案商
  • git show 命令
  • Unity中Rigidbody 刚体组件和Rigidbody类是什么?
  • 【flex-shrink】计算 flex弹性盒子的子元素的宽度大小
  • 【27】C++项目练习
  • 循环中用sleep
  • linux atomic 原子变量操作
  • 【Python报错已解决】AttributeError: ‘WindowsPath‘ object has no attribute ‘rstrip‘
  • 生成式AI:ChatGPT及其在各行业的应用前景
  • git学习报告
  • 深入探索迭代器模式的原理与应用
  • 从零开始写一个建立FAT32文件系统程序
  • MFC - 复杂控件_2
  • 【安装教程】Windows环境下Apache Jena Fuseki的安装与配置
  • qt-C++笔记之作用等同的宏和关键字
  • 模拟电路工程师面试题
  • 如何解决npm下载Puppeteer卡死的问题
  • YOLOv9改进策略【注意力机制篇】| 2024 SCI TOP FCAttention 即插即用注意力模块,增强局部和全局特征信息交互
  • Java面试指南(基础篇)
  • 如何选择适合的编程工具提高工作效率
  • Android Studio 真机USB调试运行频繁掉线问题
  • Linux:进程状态和优先级