荣耀之链论坛

 找回密码
 立即注册
搜索
查看: 71|回复: 0

rockylinux 卸载rpc服务

[复制链接]

1400

主题

2582

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
10975
发表于 2025-11-4 04:52 | 显示全部楼层 |阅读模式
https://www.doubao.com/thread/wf82669218495403b




在 Rocky Linux 中卸载或禁用 RPC 服务(通常涉及 `rpcbind` 等组件)的步骤如下,根据实际需求选择操作:


### **1. 确认 RPC 相关服务状态**
首先检查当前系统中运行的 RPC 相关服务:
```bash
# 查看 rpcbind 服务状态
systemctl status rpcbind

# 查看其他可能的 RPC 相关服务(如 nfs-utils 依赖的 RPC 组件)
systemctl list-unit-files | grep -i rpc
```


### **2. 停止并禁用 RPC 服务(不卸载软件包)**
如果只是想停止服务并禁止开机启动(保留软件包),执行:
```bash
# 停止 rpcbind 服务
sudo systemctl stop rpcbind

# 禁止开机启动
sudo systemctl disable rpcbind

# 若存在 rpcbind.socket( socket 激活方式),同样停止并禁用
sudo systemctl stop rpcbind.socket
sudo systemctl disable rpcbind.socket
```


### **3. 彻底卸载 RPC 相关软件包**
如果确认不需要 RPC 服务,可卸载相关软件包(注意:`nfs-utils` 等服务依赖 `rpcbind`,卸载可能影响 NFS 功能):
```bash
# 卸载 rpcbind 及其依赖的无用包
sudo dnf remove rpcbind

# 若存在其他 RPC 相关包(如 rpcgen 等),可一并卸载
sudo dnf remove rpcgen
```


### **4. 验证操作结果**
```bash
# 确认服务已停止
systemctl status rpcbind

# 确认软件包已卸载
rpm -q rpcbind  # 若返回 "package rpcbind is not installed" 则成功
```


**注意**:如果系统使用 NFS、NIS 等依赖 RPC 的服务,卸载 RPC 会导致这些服务失效,请根据实际业务需求操作。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

荣耀之链

GMT+8, 2025-12-12 21:34 , Processed in 0.011597 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表