欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Ubuntu16.04 安装 Redis & Redis Desktop Manager

程序员文章站 2024-03-20 16:00:34
...

安装 Redis

1、更新
sudo apt update

2、安装Redis
sudo apt install redis-server

3、启动
sudo /etc/init.d/redis-server start
&
redis-server

4、检查是否运行

$ redis-cli
# 该命令会打开如下Redis提示:
127.0.0.1:6379> 
# 输入ping
127.0.0.1:6379> ping
PONG
# 说明成功安装

ctrl + c 退出

5、配置远程登入

#编辑redis配置文件
sudo vi /etc/redis/redis.conf
#注释下面这一行 可是被其他ip链接
#bind 127.0.0.1
#找到下面这一行并去除注释 并修改成自己的密码
#requirepass foobared 
requirepass 666666 #666666即为密码

6、重启redis

sudo service redis-server stop
sudo redis-server /etc/redis/redis.conf

安装Redis Desktop Manager

1、下载rdm的deb安装包
wget https://github.com/uglide/RedisDesktopManager/releases/download/0.8.3/redis-desktop-manager_0.8.3-120_amd64.deb --no-check-certificate

2、安装zlib1g-dev
sudo apt-get install zlib1g-dev

3、用apt安装libicu52会出现没有安装包的情况,因此需要切换成其他源

su root
cd /etc/apt
cp sources.list sources.list.bak //备份
vi sources.list
#将sources.list里面的内容全部删除然后换上其它的源,比如163或阿里的
apt-get clean
apt-get update
apt-get upgrade
#安装libicu52
sudo apt-get install libicu52

桌面版的也可以在设置里切换

阿里源:

deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

163源:

deb http://mirrors.163.com/ubuntu/ precise main universe restricted multiverse
deb-src http://mirrors.163.com/ubuntu/ precise main universe restricted multiverse
deb http://mirrors.163.com/ubuntu/ precise-security universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ precise-security universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ precise-updates universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ precise-proposed universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ precise-proposed universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ precise-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ precise-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ precise-updates universe main multiverse restricted

4、安装Redis Desktop Manager的rdm
sudo dpkg -i redis-desktop-manager_0.8.3-120_amd64.deb

5、安装完成
Ubuntu16.04 安装 Redis & Redis Desktop Manager

6、连接redis
Ubuntu16.04 安装 Redis & Redis Desktop Manager

参考:https://blog.csdn.net/daxiyou/article/details/79357055