ubuntu – 如何安装最新的稳定版Redis?

我是redis的新手.我只是按照cli安装redis sudo apt-get install redis.
但安装服务器版本是2.2.12.如果我想更新这个版本并且我想安装redis 2.7那么我该怎么做呢,请帮忙.我正在研究ubuntu 12.04
source编译或通过 fpm构建.deb包:

用gem安装fpm:

# apt-get install rubygems
# gem install fpm

编译Redis

# cd /usr/local/src/
# wget http://redis.googlecode.com/files/redis-2.4.16.tar.gz
# tar zxvf redis-2.4.16.tar.gz 
# cd redis-2.4.16/
# make

构建.deb包:

# mkdir -p /tmp/redis-$VERSION.$$/usr/bin
# mkdir -p /tmp/redis-$VERSION.$$/etc

#cp src / {redis-benchmark,redis-check-aof,redis-check-dump,redis-cli,redis-server} /tmp/redis-$VERSION.$$/usr/bin

# cp redis.conf /tmp/redis-$VERSION.$$/etc/redis.conf
# cd ..

#fpm -s dir -t deb -n redis-server -v 2.4.16 -C /tmp/redis-2.4.16.18597/ -p redis-server-2.4.16_amd64.deb usr / bin /

升级Redis

# dpkg -i redis-server-2.4.16_amd64.deb
dpkg: warning: downgrading redis-server from 2:2.2.12-1build1 to 2.4.16.
(Reading database ... 148744 files and directories currently installed.)
Preparing to replace redis-server 2:2.2.12-1build1 (using redis-server-2.4.16_amd64.deb) ...
Stopping redis-server: redis-server.
Unpacking replacement redis-server ...
dpkg: warning: unable to delete old directory '/var/log/redis': Directory not empty
dpkg: warning: unable to delete old directory '/etc/redis': Directory not empty
Setting up redis-server (2.4.16) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...

检查版本:

# /usr/bin/redis-server -v
Redis server version 2.4.16 (00000000:0)

资料来源:https://gist.github.com/944216

相关文章

目录前言一、创建Hadoop用户二、更新apt和安装Vim编辑器三、...
原文连接:https://www.cnblogs.com/yasmi/p/5192694.html ...
电脑重启后,打开VirtualBox,发现一直用的虚拟机莫名的消失...
参见:https://blog.csdn.net/weixin_38883338/article/deta...
Ubuntu 18.04 LTS 已切换到 Netplan 来配置网络接口。Netpla...
介绍每个 Web 服务都可以通过特定的 URL 在 Internet 上访问...