10

I am trying to install Redis on centos 6.5 (x64) with following line:

yum install redis

But I am getting following screen:

[root@NodeJs ~]# yum install redis
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: nl.mirror.eurid.eu
 * epel: nl.mirror.eurid.eu
 * extras: mirror.denit.net
 * updates: nl.mirror.eurid.eu
Resolving Dependencies
--> Running transaction check
---> Package redis.x86_64 0:2.8.14-2.el7 will be installed
--> Processing Dependency: systemd for package: redis-2.8.14-2.el7.x86_64
--> Processing Dependency: systemd for package: redis-2.8.14-2.el7.x86_64
--> Processing Dependency: libjemalloc.so.1()(64bit) for package: redis-2.8.14-2.el7.x86_64
--> Running transaction check
---> Package jemalloc.x86_64 0:3.6.0-1.el7 will be installed
---> Package redis.x86_64 0:2.8.14-2.el7 will be installed
--> Processing Dependency: systemd for package: redis-2.8.14-2.el7.x86_64
--> Processing Dependency: systemd for package: redis-2.8.14-2.el7.x86_64
--> Finished Dependency Resolution
Error: Package: redis-2.8.14-2.el7.x86_64 (epel)
           Requires: systemd
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

How can I resolve this problem ?

Tolgay Toklar
  • 247
  • 1
  • 2
  • 7

3 Answers3

19

Here's my successful experience of updating Redis (2.4.10) on CentOS 6.5.

How to update Redis on CentOS 6.5

  1. First, make sure the following repos, EPEL and REMI, are installed:

    sudo rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    sudo rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-6.rpm
    
  2. Check the version of Redis in REMI repo: (As of June 2015, the version is 2.8.13)

    yum --enablerepo=remi info redis
    
  3. Then install related dependency (jemalloc) from EPEL repo:

    sudo yum --enablerepo=epel install jemalloc
    
  4. Before installation, you should stop the old Redis daemon:

    sudo service redis stop
    
  5. Then install the newer version of Redis:

    sudo yum --enablerepo=remi install redis
    
  6. Edit Redis configuration file if needed:

    sudo vi /etc/redis.conf
    
  7. Restart Redis daemon, and make it auto-start on reboot:

    sudo service redis start
    sudo chkconfig redis on
    
  8. Finally, check the version of currently installed Redis:

    redis-cli info | grep redis_version
    

Done!

Rockallite
  • 321
  • 3
  • 4
  • This is great, thanks! I did have to edit my `/etc/redis.conf` removing all `vm-` and `hash-` prepended directives – pruett Aug 27 '15 at 13:49
  • Thanks, I didn't realize that was available in remi. As of Oct 22 2015 its v3.0.5 and it installed perfectly (w/ cPanel) http://rpms.famillecollet.com/enterprise/6/remi/x86_64/repoview/redis.html. If you use PHP don't forget to add the module via `pecl install redis`. – dhaupin Oct 22 '15 at 17:53
  • I would also add a(n optional) step in there after step 1, editing `/etc/yum.repos.d/remi-safe.repo` adding a line `includepkgs=redis` so *only* the redis package is updated from the remi repo when it's time to run `yum update`. – Dale C. Anderson Nov 13 '15 at 21:51
  • Still works in 2019. – rolkos Oct 22 '19 at 12:52
18

You installed the EPEL repository for EL7, but you are actually running EL6. Remove the epel-release package, i.e., sudo yum search epel && sudo yum remove epel-release and replace it with the correct package.

According to this documentation Redis could be installed on CentOS6 by issuing the following commands:

// --- Compiling ---
$ wget http://download.redis.io/releases/redis-2.8.3.tar.gz
$ tar xzvf redis-2.8.3.tar.gz
$ cd redis-2.8.3
$ make
$ make install

// --- or using yum ---
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
$ rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-6.rpm

$ yum --enablerepo=remi,remi-test install redis 
Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
7

EPEL redis package are kind of outdated, on RHEL6 you can use Remi's Repository: http://rpms.famillecollet.com/. They are up to date, also with the latest releases from 3.0 and 2.8 versions.

Have a look here for a description of the latest packages.

Petre
  • 71
  • 2
  • 2
  • // , The Remi repository will attempt to update every other package, though, if there's a ```yum update```, though, right? – Nathan Basanese Nov 06 '15 at 20:28
  • 1
    // , How can I avoid that problem? – Nathan Basanese Nov 06 '15 at 20:28
  • @NathanBasanese it's worth you asking this in a separate question (more people will undoubtedly also have the same one) but for the sake of instant gratification, you add a `includepkgs=redis` line to the `[remi-safe]` section of `/etc/yum.repos.d/remi-safe.repo` to make sure only the redis package is updated. – Dale C. Anderson Nov 14 '15 at 00:10