---
title: OBClient 升级后导致 obclient 命令找不到且卸载报错-OceanBase数据库使用指南
description: 了解OceanBase数据库在实际应用中关于OBClient 升级后导致 obclient 命令找不到且卸载报错相关的常见问题和使用技巧，帮助您快速解决OBClient 升级后导致 obclient 命令找不到且卸载报错的难题。
image: https://mdn.alipayobjects.com/huamei_22khvb/afts/img/A*OSPzQ6GUQF4AAAAAQHAAAAgAeiGDAQ/original
---
[OceanBase AI 数据大会](https://www.oceanbase.com/conference2026 "OceanBase AI 数据大会")

## 体验新一代 AI 数据平台

[立即咨询](https://www.oceanbase.com/contactus) [免费试用 免费试用](https://www.oceanbase.com/free-trial)划线反馈

# OBClient 升级后导致 obclient 命令找不到且卸载报错

更新时间：2026-07-24 10:01

内容类型：Troubleshoot  

本文介绍 OBClient 升级后导致 obclient 命令找不到且卸载报错。

## 适用版本

OceanBase 数据库 V2.2.x、V3.1.x、V3.2.x 版本。

## 问题现象

1. OBClient 升级后，报如下错误。

   ```shell
   obclient --version
   -bash: obclient: command not found

   ```
 2. 升级 OBClient 后再卸载报错。

   ```shell
   rpm -ev obclient-2.2.3-20230515141610.el7.x86_64

   Preparing packages...

   rm: cannot remove '/usr/bin/obclient': No such file or directory

   rm: cannot remove '/usr/bin/mysql_config': No such file or directory

   error: %preun(obclient-2.2.3-20230515141610.el7.x86_64) scriptlet failed, exit status 1

   error: obclient-2.2.3-20230515141610.el7.x86_64: erase failed

   ```

详情如下：

OBClient V1.x 升级 OBClient V2.x 后报 obclient 命令找不到。

![1](https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/doc/img/knowledge-base/middleware_and_drivers/client/the-obclient-command-reports-an-error-after-the-obclient-upgrade-1.png)

OBClient V2.x 升级 OBClient V2.x 同样问题。

![2](https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/doc/img/knowledge-base/middleware_and_drivers/client/the-obclient-command-reports-an-error-after-the-obclient-upgrade-2.png)

## 问题原因

OBClient 升级脚本的问题。

## 解决方法

1. `-bash: obclient: command not found` 手动执行或卸载后重新安装。

   详情步骤如下：

   ```shell
   # obclient --version
   -bash: obclient: command not found

   ```

   ```shell
   # rpm -qa|grep obclient
   obclient-2.2.3-20230515141610.el7.x86_64

   ```

   ```shell
   # rpm -ql obclient-2.2.3-20230515141610.el7.x86_64|grep 'bin/obclient'
   /u01/obclient/bin/obclient

   ```

   ```shell
   # /u01/obclient/bin/obclient --version
   /u01/obclient/bin/obclient  Ver 2.2.3 Distrib 10.4.18-MariaDB, for Linux (x86_64) using readline 5.1

   ```

   ```shell
   # ln -s /u01/obclient/bin/obclient /usr/bin/obclient

   ```

   ```shell
   # ls -lt /usr/bin/obclient
   lrwxrwxrwx 1 root root 26 May 18 17:25 /usr/bin/obclient -> /u01/obclient/bin/obclient

   ```

   ```shell
   # obclient --version
   obclient  Ver 2.2.3 Distrib 10.4.18-MariaDB, for Linux (x86_64) using readline 5.1

   ```

   ```shell
   rpm -qa|grep obclient
   obclient-2.2.3-20230515141610.el7.x86_64

   ```

   ```shell
   rpm -ev obclient-2.2.3-20230515141610.el7.x86_64 --noscripts
   Preparing packages...
   obclient-2.2.3-20230515141610.el7.x86_64

   ```

   ```shell
   rpm -ivh obclient-2.xxxxx
   Preparing...                          ################################# [100%]
   Updating / installing...
      1:obclient-xxxxxxxxxxxxxxxxxxxxxxx ################################# [100%]

   ```
 2. OBClient 升级后卸载报错。

   ```shell
   # rpm -ev obclient-2.2.1-20221122151945.el7.alios7.x86_64
   Preparing packages...
   rm: cannot remove '/usr/bin/obclient': No such file or directory
   rm: cannot remove '/usr/bin/mysql_config': No such file or directory
   error: %preun(obclient-2.2.1-20221122151945.el7.alios7.x86_64) scriptlet failed, exit status 1
   error: obclient-2.2.1-20221122151945.el7.alios7.x86_64: erase failed

   ```

   ```shell
   # rpm -ev obclient-2.2.1-20221122151945.el7.alios7.x86_64 --force
   rpm: only installation and upgrading may be forced

   ```

   ```shell
   # rpm -ev obclient-2.2.1-20221122151945.el7.alios7.x86_64 --nodeps
   Preparing packages...
   rm: cannot remove '/usr/bin/obclient': No such file or directory
   rm: cannot remove '/usr/bin/mysql_config': No such file or directory
   error: %preun(obclient-2.2.1-20221122151945.el7.alios7.x86_64) scriptlet failed, exit status 1
   error: obclient-2.2.1-20221122151945.el7.alios7.x86_64: erase failed

   ```

   通过增加 --noscripts 解决：

   ```shell
   # rpm -ev obclient-2.2.1-20221122151945.el7.alios7.x86_64 --noscripts
   Preparing packages...
   obclient-2.2.1-20221122151945.el7.alios7.x86_64

   ```

Previous

[obclient error loading shared libraries](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000000210063)

Next

[OBClient 上执行 status 命令后断连](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000000210065) ![有帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*y6ocSqN8cqsAAAAAAAAAAAAAARQnAQ)![无帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*BG9IQJyLHF8AAAAAAAAAAAAAARQnAQ)![反馈](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*eTWdQKCRKHwAAAAAAAAAAAAAARQnAQ) 咨询
