How to uninstall Redis server from Ubuntu

Today I came across with a bit of a problem while trying to remove Redis 2.6 from one of my servers. The problem was, when I was installing at the first time I used make install  (Source build) instead of apt-get install (from repository). Since the make file didn’t had a un-install option, I had to remove it manually. In this post I will guide you through both uninstallation methods, You can chose the suitable method depending on how you installed it.

If you use apt-get

You can simply type below command in your terminal. This will remove the redis-server package and any other dependant packages which are no longer needed (Because of --auto-remove). And also it will delete your local/config files for redis-server (Because of purge).

 

If you used makefile

This is where it gets bit tricky. Because you will have to manually remove installed files. Here is how to do it;

1. Stop Redis server if it’s already running. Remember if you have more than one instance, you have to stop all of them. In my case I only have redis_6379 running at the moment.

2.  Now delete everything related to Redis server from /usr/local/bin/

3. Now delete Redis Configuration files directory and it’s content.

4. Delete existing Redis log files.

5. Delete existing Redis data directory and it’s content.

6. Delete existing Redis server init scripts

7. Remove existing Redis PID files (Only if exists)

8. Restart your Ubuntu server.

9. Now Redis is completely removed from your Server.

Because of any reason if you need to Re-install Redis server on your Server, refer to my article on How to install Redis server in Ubuntu

If you find this useful, Please leave a comment below.