redis包安装时出错

redis包安装时出错

在我的服务器上,我使用 Plesk 控制面板,我使用 Hetzner Cloud 的服务器。问题是,当我尝试按照面板的说明安装redis时 -https://ontwerps.nl/install-redis-with-plesk-onyx,最后我得到一个错误:

This systems seems to use systemd. Please take a look at the provided example service unit files in this directory, and adapt and install them. Sorry!

在此之前,我有时会出现错误/bin/sh:1:pkg-config: not found,但我用命令纠正它apt-get install -y pkg-config,错误的原因可能是什么?我尝试在 Debian 9 和 Ubuntu 18.04 上安装,错误是相同的。我如何解决 systemd 问题并安装 redis-stable?

答案1

我遵循的步骤使其在我的系统中运行

注释掉redis-stable/utils/instal_server.sh文件中的以下行

#bail if this system is managed by systemd
#_pid_1_exe="$(readlink -f /proc/1/exe)"
#if [ "${_pid_1_exe##*/}" = systemd ]
#then
#       echo "This systems seems to use systemd."
#       echo "Please take a look at the provided example service unit files in this directory, and adapt and install them. Sorry!"
#       exit 1
#fi

之后,您需要安装tcl tk

对于Ubuntu:sudo apt-get install -y tcl tk

对于红帽:sudo yum install tcl tk

然后内redis-stable/srcsudo make install

如果它显示错误,例如 Hint: It's a good idea to run 'make test' ;)

返回到 redis-stable 并make distclean再次运行sudo make install

最后,通过运行来运行服务器redis-server

最后检查 Redis 是否正常工作:redis-cli ping

相关内容