5

Tried to install redis-server using Kubuntu 16.04 64 bit version using:

sudo apt install redis-server

But receive this message while installing:

Setting up redis-server (2:3.0.7-1~dotdeb+6.1) ...
Job for redis-server.service failed because a timeout was exceeded. See "systemctl status redis-server.service" and "journalctl -xe" for details.
invoke-rc.d: initscript redis-server, action "start" failed.
dpkg: error processing package redis-server (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 redis-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

Tried to run "journalctl -xe" and found this:

redis-server.service: PID file /var/run/redis/redis-server.pid not readable (yet?) after start-post: No such file or directory

Any idea to fix this issue?

* Update *

"df -h" result:

Filesystem      Size  Used Avail Use% Mounted on
udev            3,9G     0  3,9G   0% /dev
tmpfs           789M  9,6M  780M   2% /run
/dev/sda2       909G   24G  840G   3% /
tmpfs           3,9G  175M  3,7G   5% /dev/shm
tmpfs           5,0M  4,0K  5,0M   1% /run/lock
tmpfs           3,9G     0  3,9G   0% /sys/fs/cgroup
/dev/sda1       511M  3,6M  508M   1% /boot/efi
tmpfs           789M     0  789M   0% /run/user/118
tmpfs           789M   12K  789M   1% /run/user/1000

"df -h /var/run" result:

Filesystem      Size  Used Avail Use% Mounted on
tmpfs           789M  9,6M  780M   2% /run
Yansen Tan
  • 181
  • 1
  • 1
  • 6

5 Answers5

7

You should probably alter the redis.conf file to force it to use IPv4 if it supports that mode only and then maybe you could run it without IPv6.

nano /etc/redis/redis.conf

Simply remove the ::1 IPv6 loopback address from the bind config option:

- bind 127.0.0.1 ::1
+ bind 127.0.0.1

Now redis will not try to use the IPv6 network.

Try to install again

apt install redis-server

Test the Redis Instance Functionality To test that your service is functioning correctly, connect to the Redis server with the command-line client:

redis-cli

In the prompt that follows, test connectivity by typing:

ping You should see:

$ 127.0.0.1:6379> ping

Output

PONG

Check that you can set keys by typing:

$ 127.0.0.1:6379> set test "It's working!"

Output

OK

Now, retrieve the value by typing:

$ 127.0.0.1:6379> get test

You should be able to retrieve the value we stored:

Output

$ 127.0.0.1:6379> "It's working!"

Exit the Redis prompt to get back to the shell:

127.0.0.1:6379> exit

As a final test, let's restart the Redis instance:

$ sudo systemctl restart redis
Benson K B
  • 71
  • 1
  • 2
3

I end up removing redis which installed from apt-get and install the latest stable version from redis website manually. It works fine now... And I use this guide: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-redis-on-ubuntu-16-04

Yansen Tan
  • 181
  • 1
  • 1
  • 6
0

It is possible that certain files have the immutable attribute set; e.g.,

---- i --------- e ---- /bin/su
---- i --------- e ---- /usr/bin/passwd
---- i --------- e ---- /usr/bin/chattr
---- i --------- e ---- /usr/sbin/adduser
---- i --------- e ---- /usr/sbin/useradd
---- i --------- e ---- /usr/sbin/userdel
---- i --------- e ---- /usr/sbin/usermod
---- i --------- e ---- /usr/sbin/groupadd
---- i --------- e ---- /usr/sbin/groupdel
---- i --------- e ---- /usr/sbin/groupmod
---- i --------- e ---- /usr/sbin/visudo
---- i --------- e ---- /usr/bin/apt-get
---- i --------- e ---- /usr/bin/dpkg
---- i --------- e ---- /etc/passwd
---- i --------- e ---- /etc/shadow
---- i --------- e ---- /etc/group
---- i --------- e ---- /etc/hostname

You can check it by doing lsattr /usr/bin/passwd.

You must run chattr -i FILES; for example, chattr -i /usr/sbin/adduser.

After modifying the attribute, try to reinstall redis-server.

0

For me, the issue was related to the port not being open. So I had to do: sudo iptables -A INPUT -p tcp --dport 6379 -j ACCEPT

tanikB
  • 1
0

You can install the latest stable version of Redis from the Snapcraft marketplace:

sudo snap install redis