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 ?

  • 1
    systemd is not included in EPEL6. [1]: stackoverflow.com/questions/28347694/… – 030 Feb 15 '15 at 19:22
  • 1
    Oh,I have to upgrade to centos 7 right ? – Tolgay Toklar Feb 15 '15 at 19:34
  • That is an option, but you could try the answer of Michael Hampton first. It is not included in EPEL6, but it is possible to install it on CentOS6 by installing another package. – 030 Feb 15 '15 at 19:46
  • 1
    I added comment to his answer please look at this – Tolgay Toklar Feb 15 '15 at 19:48
  • 1
    excellent question! + 1 – l--''''''---------'''''''''''' May 27 '15 at 1:16
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 
| improve this answer | |
  • 1
    How can I replace it ? Can you give an example ? – Tolgay Toklar Feb 15 '15 at 18:53
  • 1
    Update:I am using centos 6.6 does it matter ? – Tolgay Toklar Feb 15 '15 at 19:37
  • 1
    I tried second option: Public key for jemalloc-3.6.0-1.el7.x86_64.rpm is not installed – Tolgay Toklar Feb 15 '15 at 19:47
  • 1
    @TolgayToklar You still have the EPEL repository for EL7 installed, and you still need to remove it. – Michael Hampton Feb 15 '15 at 19:51
  • 1
    yum clean metadata – Uday Hiwarale Mar 27 '15 at 13:24
18

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!

| improve this answer | |
  • 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) rpms.famillecollet.com/enterprise/6/remi/x86_64/repoview/…. 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 Anderson Nov 13 '15 at 21:51
  • Still works in 2019. – rolkos Oct 22 '19 at 12:52
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.

| improve this answer | |
  • // , The Remi repository will attempt to update every other package, though, if there's a yum update, though, right? – Nathan Basanese Nov 6 '15 at 20:28
  • 1
    // , How can I avoid that problem? – Nathan Basanese Nov 6 '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 Anderson Nov 14 '15 at 0:10

Not the answer you're looking for? Browse other questions tagged or ask your own question.