One of our critical service was under Ubuntu 16.04 LTS (and is scheduled for update, but this a another story!) and how it always happens other parts of our systems use new versions of Ubuntu. But the latest version in Ubuntu 16.04 is 3.0.6 https://packages.ubuntu.com/xenial-updates/redis-server.
Here you can find all the redis server versions available in the supported Ubuntu distributions: https://packages.ubuntu.com/search?keywords=redis-server&searchon=names
srv-redis1 ~ # wget http://security.ubuntu.com/ubuntu/pool/universe/r/redis/redis-tools_4.0.9-1ubuntu0.1_amd64.deb srv-redis1 ~ # wget http://security.ubuntu.com/ubuntu/pool/universe/r/redis/redis-server_4.0.9-1ubuntu0.1_amd64.deb srv-redis1 ~ # dpkg -i redis-* (Reading database ... 104745 files and directories currently installed.) Preparing to unpack redis-server_4.0.9-1ubuntu0.1_amd64.deb ... /usr/sbin/invoke-rc.d: 1: /usr/sbin/invoke-rc.d: /sbin/runlevel: not found invoke-rc.d: could not determine current runlevel Stopping redis-server: redis-server. Unpacking redis-server (5:4.0.9-1ubuntu0.1) over (2:3.0.6-1ubuntu0.3) ... dpkg: warning: unable to delete old directory '/etc/redis/redis-server.post-down.d': Directory not empty dpkg: warning: unable to delete old directory '/etc/redis/redis-server.post-up.d': Directory not empty dpkg: warning: unable to delete old directory '/etc/redis/redis-server.pre-down.d': Directory not empty dpkg: warning: unable to delete old directory '/etc/redis/redis-server.pre-up.d': Directory not empty Preparing to unpack redis-tools_4.0.9-1ubuntu0.1_amd64.deb ... Unpacking redis-tools (5:4.0.9-1ubuntu0.1) over (2:3.0.6-1ubuntu0.3) ... Setting up redis-tools (5:4.0.9-1ubuntu0.1) ... Setting up redis-server (5:4.0.9-1ubuntu0.1) ... Installing new version of config file /etc/default/redis-server ... Installing new version of config file /etc/init.d/redis-server ... Configuration file '/etc/redis/redis.conf' ==> Modified (by you or by a script) since installation. ==> Package distributor has shipped an updated version. What would you like to do about it ? Your options are: Y or I : install the package maintainer's version N or O : keep your currently-installed version D : show the differences between the versions Z : start a shell to examine the situation The default action is to keep your current version. *** redis.conf (Y/I/N/O/D/Z) [default=N] ? N Removing obsolete conffile /etc/redis/redis-server.pre-up.d/00_example ... Removing obsolete conffile /etc/redis/redis-server.pre-down.d/00_example ... Removing obsolete conffile /etc/redis/redis-server.post-up.d/00_example ... Removing obsolete conffile /etc/redis/redis-server.post-down.d/00_example ... insserv: warning: script 'friendly-recovery' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `friendly-recovery' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `friendly-recovery' insserv: warning: script 'sysctl' missing LSB tags and overrides insserv: script nagios-nrpe-server.cfsaved: service nagios-nrpe-server already provided! insserv: warning: script 'cron' missing LSB tags and overrides insserv: Default-Start undefined, assuming empty start runlevel(s) for script `cron' insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `cron' insserv: script redis-sentinel: service redis-sentinel already provided! /usr/sbin/invoke-rc.d: 1: /usr/sbin/invoke-rc.d: /sbin/runlevel: not found invoke-rc.d: could not determine current runlevel Processing triggers for ureadahead (0.100.0-19) ... Processing triggers for man-db (2.7.5-1) ...
Restart and check whether the server is running:
srv-redis1 redis # systemctl restart redis-server.service srv-redis1 redis # systemctl status redis-server.service * redis-server.service - Advanced key-value store Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2019-01-17 15:29:04 UTC; 6s ago Docs: http://redis.io/documentation, man:redis-server(1) Process: 5465 ExecStopPost=/bin/run-parts --verbose /etc/redis/redis-server.post-down.d (code=exited, status=0/SUCCESS) Process: 5459 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCESS) Process: 5452 ExecStop=/bin/run-parts --verbose /etc/redis/redis-server.pre-down.d (code=exited, status=0/SUCCESS) Process: 5485 ExecStartPost=/bin/run-parts --verbose /etc/redis/redis-server.post-up.d (code=exited, status=0/SUCCESS) Process: 5478 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exited, status=0/SUCCESS) Process: 5472 ExecStartPre=/bin/run-parts --verbose /etc/redis/redis-server.pre-up.d (code=exited, status=0/SUCCESS) Main PID: 5481 (redis-server) CGroup: /system.slice/redis-server.service |-5481 /usr/bin/redis-server *:6379 `-5497 redis-rdb-bgsave *:6379 Jan 17 15:29:04 srv-redis1 systemd[1]: Starting Advanced key-value store... Jan 17 15:29:04 srv-redis1 run-parts[5472]: run-parts: executing /etc/redis/redis-server.pre-up.d/00_example Jan 17 15:29:04 srv-redis1 run-parts[5485]: run-parts: executing /etc/redis/redis-server.post-up.d/00_example Jan 17 15:29:04 srv-redis1 systemd[1]: Started Advanced key-value store.
Here is how you can find and download the redis-server package
STEP 1) Open https://packages.ubuntu.com and search for “redis-server” in the search box in the right top corner.
Here are the all supported versions in the various presently supported Ubuntu distributions. We chose a package from the the next LTS (remember our is 16.04) – bionic(-updates). Click on “bionic-updates”.
STEP 2) As you can see redis-server dependes on two packates: lsb-base (>= 3.12-14) and redis-tools.
The first lsb-base is a base package for all Ubuntu distributions and all of them have above 3.12 version. Of cource, you can check it in your machine. The second redis-tools you must find and download as you do for “redis-server” package. Click on “amd64” (assuming you need a 64bit binary or whatever is your type of Ubuntu distribution).