Install Redis on OpenSUSE Leap 15.4
since there is no Redis official package for OpenSUSE Leap 15.4, it is difficult for us to install Redis on this Linux. I tried several ways to install Redis, including via Snap. But both of them did not work. Finally, I tried install Redis by complying from the source.
Steps for installing Redis
First, we need to download Redis source package as we can find on the official website.
To obtain the source files for the latest stable version of Redis from the Redis downloads site, run:
wget https://download.redis.io/redis-stable.tar.gz
Compiling Redis
To compile Redis, first the tarball, change to the root directory, and then run make
:
tar -xzvf redis-stable.tar.gz
cd redis-stable
make
However, we got the error 127 and error 2.
To solve the errors, we need to install gcc, run sudo zypper install gcc
Then, we try make
again.
This time, we got error 1. To solve this issue, we need to change the settings.
First, we need to run vi src/.make-settings
In the Vim document, we need to change the OPT=-02
to OPT=-march=x86-64
Then press esc key, and type :wp and enter.
Try make
again, we can compile the source code successfully this time.
As suggested, we need to run make test
In the directory of Redis, run sudo make install
Run cd src
to go to the source folder, then run ./redis-server ../redis.conf
to start the Redis server as below.