본문 바로가기

Software Engineering/Redis

[Redis] Ubuntu에 설치된 Redis 삭제하기 (apt-get 사용)

실행 환경

  • Ubuntu 20.04.6
  • Redis 6.0.20
  • 패키지 관리자: apt-get

삭제 방법

먼저 Redis가 설치되어 있는지 확인 합니다.

# Redis 설치 확인
redis-server --version

 

삭제 명령을 실행하여 Redis를 삭제합니다.

# Redis 패키지 삭제
sudo apt-get remove --purge redis redis-server redis-tools

# 미사용 의존성 제거
sudo apt-get autoremove

 

명령어가 실행되면 Reids 패키지가 삭제됩니다.

$ sudo apt-get remove --purge redis redis-server redis-tools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  redis* redis-server* redis-tools*
The following held packages will be changed:
  redis redis-server redis-tools
0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
After this operation, 6,518 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 115157 files and directories currently installed.)
Removing redis (6:6.0.20-1rl1~focal1) ...
Removing redis-server (6:6.0.20-1rl1~focal1) ...
Removing redis-tools (6:6.0.20-1rl1~focal1) ...
Processing triggers for man-db (2.9.1-1) ...
(Reading database ... 115119 files and directories currently installed.)
Purging configuration files for redis-server (6:6.0.20-1rl1~focal1) ...
Purging configuration files for redis-tools (6:6.0.20-1rl1~focal1) ...
Processing triggers for systemd (245.4-4ubuntu3.24) ...

 

아래 명령어를 실행하여, Redis가 완전히 삭제되었는지 확인합니다.

# redis-server 버전 확인
redis-server --version

# redis-cli 버전 확인
redis-cli --version

# 패키지 목록에 redis 확인
dpkg -l | grep redis

# redis 서비스 상태 확인
sudo systemctl status redis

# redis 프로세스 확인
ps aux | grep redis

 

아래와 같이 정상적으로 redis가 삭제되었음을 확인 할 수 있습니다.

$ redis-server --version
-bash: /usr/bin/redis-server: No such file or directory

$ redis-cli --version

Command 'redis-cli' not found, but can be installed with:

sudo apt install redis-tools

$ dpkg -l | grep redis

$ sudo systemctl status redis
Unit redis.service could not be found.

$ ps aux | grep redis
jyblue    237770  0.0  0.0   6432   656 pts/0    S+   13:30   0:00 grep --color=auto redis

 

삭제 결과

  • redis 패키지 삭제 (redis, redis-server, redis-tools)