在终端下输入

sudo apt search redis

查找一下发现了 redis-server

如果找不到 你可能需要使用 update 更新一下了

sudo apt-get update

然后就安装

sudo apt-get install redis-server

安装完毕后启动 redis

/usr/bin/redis-server

启动后可以看到

21154:C 26 Jun 10:27:39.157 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
21154:C 26 Jun 10:27:39.157 # Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=21154, just started
21154:C 26 Jun 10:27:39.157 # Warning: no config file specified, using the default config. In order to specify a config file use /usr/bin/redis-server /path/to/redis.conf
21154:M 26 Jun 10:27:39.157 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
21154:M 26 Jun 10:27:39.157 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
21154:M 26 Jun 10:27:39.157 # Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 4.0.9 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 21154
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-' 21154:M 26 Jun 10:27:39.164 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
21154:M 26 Jun 10:27:39.164 # Server initialized
21154:M 26 Jun 10:27:39.164 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
21154:M 26 Jun 10:27:39.164 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
21154:M 26 Jun 10:27:39.164 * Ready to accept connections

然后开一个终端 进行cli访问

$ /usr/bin/redis-cli
127.0.0.1:6379> keys *
(empty list or set)
127.0.0.1:6379> set user name
OK
127.0.0.1:6379> get user
"name"
127.0.0.1:6379>

好了,就是这么简单。

ubuntu如何安装redis的更多相关文章

  1. 在Ubuntu中安装Redis

    原文地址:http://blog.fens.me/linux-redis-install/ 在Ubuntu中安装Redis R利剑NoSQL系列文章,主要介绍通过R语言连接使用nosql数据库.涉及的 ...

  2. ubuntu下安装redis以及redis客户端在mac下的使用

    ubuntu下安装redis http://blog.fens.me/linux-redis-install/ 此方式利用brew安装包去获取最新的rdm客户端 资源失效了 https://www.j ...

  3. 转】在Ubuntu中安装Redis

    不多说,直接上干货! 原博文出自于: http://blog.fens.me/category/%E6%95%B0%E6%8D%AE%E5%BA%93/ 感谢! 在Ubuntu中安装Redis R利剑 ...

  4. Ubuntu上面安装Redis Python

    Ubuntu上面安装Redis Python 1,下载redis源码https://redis.io/download,下载地址:http://124.205.69.169/files/A092000 ...

  5. ubuntu上安装redis和配置远程访问

    ubuntu上安装redis和配置远程访问 安装redis: 下载安装包: wget http://download.redis.io/releases/redis-4.0.1.tar.gz 解压: ...

  6. ubuntu 卸载/安装 redis

    ubuntu 卸载redis 1. 卸载软件 apt-get remove redis 2. 清除配置 apt-get remove --purge redis 3. 删除残留文件 find / -n ...

  7. Ubuntu下安装Redis并实现远程访问

    之前的一篇随笔写到Redis在Windows下的安装,但目前好多大数据处理的服务是在Linux上的,所以想以Redis为例并实现在Windows上利用C#代码远程访问. 以在Ubuntu下为例,步骤如 ...

  8. ubuntu下安装redis及常用操作

    reids是一个内存数据库,具有存取速度快,使用简单等优点.我们常常在分布式或者负载均衡的系统中使用它来缓存一些公用的且不是很大量的数据,比如session或者各类token(比如微信的access_ ...

  9. ubuntu上安装redis

    1.Redis简要介绍 访问Redis官方网站 https://redis.io/ 上面介绍到 ,redis是开源,BSD许可,高级的key-value存储系统,可以用来存储字符串,哈希结构,链表,集 ...

  10. Linux(ubuntu)安装redis集群,redis集群搭建

    今天学习一下redis集群的搭建.redis在现在是很常用的数据库,在nosql数据库中也是非常好用的,接下来我们搭建一下redis的集群. 一.准备 首先我们要安装c语言的编译环境,我们要安装red ...

随机推荐

  1. OpenVino快速落地部署教程

    OpenVino快速落地部署教程 Openvino是由Intel开发的专门用于优化和部署人工智能推理的半开源的工具包,主要用于对深度推理做优化.本教程适用于Yolov5-7.0,直接跑Yolov5为6 ...

  2. Visual Studio Code 重置“不再询问”选项

    有一次使用 VS Code 重命名一个 Python 文件时,VS Code 询问"扩展'Python'希望通过移动此文件来进行重构更改".当时没有多想,选中"不再提问& ...

  3. k8s pod挂载hostPath执行写时报错Permission denied

    关于hostPath的权限说明 最近项目中经常遇到pod中container挂载主机hostPath报错无权限问题: httpd@hostpath-volume:/test-volume$ touch ...

  4. LeetCode题集-3 - 无重复字符的最长子串

    题目:给定一个字符串 s ,请你找出其中不含有重复字符的最长子串的长度. 我们先来好好理解题目,示例1中怎么得到长度为3的? 如果以第一个字符a为起始,不含重复的最长子串是abc:则我们这样表示(a) ...

  5. Git 基本配置与常用命令

    使用Git会用到一些基本的Linux命令,比如: ls/ll   查看当前目录 cat   查看文件内容 touch   创建文件 vi   vi编辑器(使用vi编辑器方便展示效果) 安装成功 右击桌 ...

  6. JavaScript中if嵌套assert的方法

    在JavaScript中,通常我们不会直接使用assert这个词,因为JavaScript标准库中并没有直接提供assert函数(尽管在一些测试框架如Jest.Mocha中经常看到).但是,我们可以模 ...

  7. USB TCPM

    USB TCPM(Type-C Port Manager)的主要作用是管理 USB Type-C 端口的连接和电源传输协议(USB Power Delivery, PD),确保设备正确识别.协商和切换 ...

  8. wpf之样式

    在Window.Resources中书写样式 : <Window.Resources> <Style TargetType="Button" > </ ...

  9. nodejs 和 npm 版本对应关系

    一.nodejs 和 npm 的版本是有适配的 首先看下官网列明的大概匹配关系: 官网链接地址:https://nodejs.org/zh-cn/about/previous-releases 可以查 ...

  10. python 生成requirements 文件

    python 要生成 requirements文件 有两种情况 具有独立的虚拟环境 全局环境 具有独立的虚拟环境 pip freeze > requirements.txt 全局环境 安装 pi ...