Error “Requires: systemd” When Installing Redis on CentOS 6.5: Solutions and Workarounds


2 views

The error occurs because EPEL repository provides Redis packages compiled for CentOS 7 (systemd-based), while CentOS 6.5 uses SysV init. The key problematic lines in the error output are:

--> Processing Dependency: systemd for package: redis-2.8.14-2.el7.x86_64
Error: Package: redis-2.8.14-2.el7.x86_64 (epel)
           Requires: systemd

First, add the Remi repository which maintains Redis packages for CentOS 6:

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum --enablerepo=remi install redis

For complete control over the installation process:

wget http://download.redis.io/releases/redis-3.2.13.tar.gz
tar xzf redis-3.2.13.tar.gz
cd redis-3.2.13
make
make install

Configure Redis to start automatically:

cp utils/redis_init_script /etc/init.d/redis
chkconfig --add redis
chkconfig --level 345 redis on

Edit the main configuration file:

mkdir /etc/redis
cp redis.conf /etc/redis/6379.conf

Key parameters to adjust in /etc/redis/6379.conf:

daemonize yes
pidfile /var/run/redis_6379.pid
logfile /var/log/redis_6379.log
dir /var/lib/redis/6379

Start Redis service and verify:

service redis start
redis-cli ping
# Should return "PONG"

If encountering permission issues:

mkdir -p /var/lib/redis/6379
chown redis:redis /var/lib/redis/6379

When attempting to install Redis on CentOS 6.5 using yum install redis, you'll encounter dependency conflicts because the default EPEL repository provides packages built for CentOS 7 (which uses systemd) rather than CentOS 6.

The error occurs because:

  • The EPEL repo defaults to CentOS 7 packages
  • Redis 2.8.14 requires systemd (init system in CentOS 7)
  • CentOS 6.5 uses Upstart/SysVinit instead

Method 1: Install from Remi Repository

First, enable the Remi repository:

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum --enablerepo=remi install redis

Method 2: Manual Compilation

For maximum control:

wget http://download.redis.io/releases/redis-3.2.13.tar.gz
tar xzf redis-3.2.13.tar.gz
cd redis-3.2.13
make
make install

After successful installation:

# Configure Redis as service
chkconfig redis on
service redis start

# Verify installation
redis-cli ping

Remember that CentOS 6 reached EOL in November 2020. For production environments, consider upgrading to CentOS 7/8 or migrating to compatible Redis cloud services.

If you're using this for development, consider Docker containers:

docker run --name redis-dev -d -p 6379:6379 redis:5.0