我混淆了 redis 安裝。我已經嘗試使用任何教程卸載 redis,也嘗試手動卸載。但是,redis 仍然使用 6379 埠。
dna@dna:~$ sudo netstat -tulnp | grep 6379
[sudo] password for dna:
tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 22141/redis-server
tcp6 0 0 :::6379 :::* LISTEN 22141/redis-server
dna@dna:~$ apt-get autopurge redis-server
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
dna@dna:~$ sudo apt-get autopurge redis-server
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'redis-server' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 45 not upgraded.
dna@dna:~$ sudo apt-get autopurge redis*
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package redis-stable
E: Unable to locate package redis-stable.tar.gz
E: Couldn't find any package by glob 'redis-stable.tar.gz'
E: Couldn't find any package by regex 'redis-stable.tar.gz'
dna@dna:~$ redis-cli
我的 docker 應用程式使用的 redis 已經停止,redis 影像也已經洗掉。
這是我的作業系統:
dna@dna:~$ hostnamectl
Static hostname: dna
Icon name: computer-laptop
Chassis: laptop
Machine ID: -------
Boot ID: -------
Operating System: Linux Mint 21
Kernel: Linux 5.15.0-41-generic
Architecture: x86-64
Hardware Vendor: Lenovo
Hardware Model: -------
uj5u.com熱心網友回復:
的輸出是ps -auxf | grep -i redis什么?
也許安裝了另一個 redis 應用程式,輸出是dnf list installed | grep -i redis什么?
另外,什么是輸出systemctl | grep -i redis
如果所有這些都沒有帶來任何有價值的提示,請嘗試安裝 mlocate w dnf install mlocate -y ; updatedb。
然后搜索磁盤上的每個 redis 檔案:
locate -i redis
uj5u.com熱心網友回復:
您可以使用以下命令找到正在偵聽埠 6379 的 PID:fuser -n tcp 6379
一個例子:
[root@server ~]# fuser -n tcp 22
22/tcp: 4837 34711
[root@server ~]#
如果你不能停止服務,你可以殺死它:kill -9 <pid>
uj5u.com熱心網友回復:
您可以嘗試以 root 身份登錄,然后卸載 redis-server。因為帳戶 dna 無法讀取檔案 /var/lib/dpkg/lock-frontend
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/534561.html
標籤:Linux码头工人雷迪斯
上一篇:ReactiveCosmosRepository洗掉功能不起作用
下一篇:使用awk列印所有最大值
