I installed redis-server with aptitude on Ubuntu server 10.04 LTS.
I realized it was really old, and so I tried aptitude remove.
Then I downloaded the source from Redis.io and compiled it like I should've done to begin with.
As far as config goes, all I did differently was change daemonize no to yes in the redis.conf file, save it, then
root> redis-server /root/source/redis-2.6.8/redis.conf
*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 109
>>> 'stop-writes-on-bgsave-error yes'
Bad directive or wrong number of arguments
So I tried running
apt-get -o DPkg::options::=--force-confmiss --reinstall install redis-server
Now redis-server starts, but when I try to run redis-cli I get...
#> redis-cli
usage: redis-cli [-h host] [-p port] [-r repeat_times] [-n db_num] cmd arg1 arg2 arg3 ... argN
usage: echo "argN" | redis-cli [-h host] [-p port] [-r repeat_times] [-n db_num] cmd arg1 arg2 ... arg(N-1)
If a pipe from standard input is detected this data is used as last argument.
example: cat /etc/passwd | redis-cli set my_passwd
example: redis-cli get my_passwd
example: redis-cli -r 100 lpush mylist x
If you see any of the above errors, you have a super old version of Redis, or someone previously installed it via package manager. You're seeing the redis-cli output from 1.2 or some such, before it was an interactive shell.
A tip over here
said to
sudo add-apt-repository ppa:chris-lea/redis-server
sudo apt-get update
sudo apt-get install redis-server
When I tried that, it complained that it didn't know how to add-apt-repository ! Sheesh.
So I found this
which said to
sudo apt-get update && sudo apt-get install python-software-properties
Great, after that, I had a go at this again
sudo apt-get install redis-server
and it worked, but I still had only Redis 2.4.x
I ended up finding everything related to redis on the whole system, deleting it and starting over, using the four simple steps on redis.io/download. It works fine now.
Moral of the story: Package managers are awesome, except when they aren't. Just use make!