Uninstall Redis from Ubuntu – How we do it
Are you looking for how to uninstall Redis from Ubuntu? We can help you with it.
Website performance enhancing tools like Redis can be installed either from the repository or from the source.
But improper uninstallation leaves redundant files and affects the working of Redis.
At Bobcares, we often get requests to uninstall Redis and reinstall, as a part of our Server Management Services.
Today, let’s see a brief guide on how our Support Engineers make Redis working.
What is Redis?
Redis aka Remote Dictionary Server is an open-source, in-memory, data structure server. Its major application is to deliver fast loading websites by enabling caching.
We can install Redis in two ways. One way is the installation from the repository.
Whereas, the other way is manually installing Redis using the makefile. This is called installing from the source.
Customers often approach us to uninstall Redis when they got stuck due to improper installation. Usually, this happens when there are multiple installations of the same package.
Hence, while uninstalling a package its important to remove its dependencies and related data files to avoid further errors.
So let’s see how our Support Engineers do a complete removal of Redis from an Ubuntu server.
Error due to improper uninstall
In some servers, checking the redis-server status shows up as,
Usually, this error denotes a redundant package left after removing Redis. So to fix this, we need to completely remove the existing package and then do a complete installation.
So let’s see how to completely uninstall the Redis package from the server.
How to uninstall Redis from Ubuntu?
The uninstallation process depends on the way the user installs a package. So let’s see how our Support Engineers uninstall Redis properly in both cases.
1. Using the package manager
The Ubuntu server install packages with apt-get. So in such cases, we uninstall Redis using the command,
apt-get purge --auto-remove redis-servers
--auto-remove option removes the Redis server package and its dependencies.
purge option removes the configuration and other Redis related data files.
This successfully uninstalls the Redis from the Ubuntu server.
After uninstalling the package, in the Ubuntu system check if the package is present or not. For this, we use the command,
apt-cache policy redis-server
This command gives the status of the package in the server. A server without Redis server shows up as:
root@serv:~# apt-cache policy redis-server redis-server: Installed: (none)
2. Uninstall Redis manually
Some customers install the Redis by compiling the source package. Hence we need to remove it manually.
Let’s see how our Support Engineers do this.
Initially, we stop the Redis server, using the command,
systemctl stop redis
Next, we remove the Redis file from the server. First, we remove the files in /usr/local/bin using the command,
Then we remove the configuration.
rm /etc/redis/redis.conf rm -r /etc/redis/
Next, we remove the log files using the command,
Similarly, we remove the data directory.
rm -r /var/lib/redis/
Finally, we remove the init scripts.
Later we check for any PID file and remove that too.
Finally, we restart the server to completely remove Redis.
[Still, having trouble in uninstalling Redis? – We can help you.]
In short, proper uninstalling of Redis involves removing the dependencies and related data files. Today, we saw how our Support Engineers uninstall Redis from Ubuntu without any remnants.