如何使用ESXCLI命令删除VMware ESXi上的软件包

原文链接:如何使用ESXCLI命令删除VMware ESXi上的软件包

本文以删除ESXi主机上的两个戴尔软件包:dell-configuration-vib 和 dell-osname-idrac 为例,介绍如何使用esxcli命令删除VMware ESXi上的软件包(本文共计3056个字,代码输出结果比较多,预计阅读时间5分钟)

注意事项

  • 在删除软件包之前,一定要确保你清楚软件包的作用,并且确认删除该软件包不会对 ESXi 主机的正常运行和其上运行的虚拟机造成不良影响。
  • 建议在删除软件包之前备份相关的数据和配置。
  • 删除软件包需要将ESXi主机进入维护模式
  • 删除软件包操作无法撤销
  • ESXi自带的软件包,请勿随便删除

使用ESXCLI命令删除VMware ESXi上的软件包的具体步骤

第1步,将ESXi主机进入维护模式,具体步骤参考:《如何将ESXi主机置于或退出维护模式?

第2步,访问VMware ESXi的命令,具体步骤参考:《如何访问VMware ESXi的本地命令行(Shell)》或《如何开启VMware ESXi的SSH和Shell服务

第3步,使用esxcli software vib list命令来查看当前 ESXi 主机上安装的所有软件包(VIB – VMware Installation Bundle)。这个命令会列出软件包的名称、版本、供应商等详细信息。例如:

[root@VMNote:~] esxcli software vib listName                           Version                                Vendor  Acceptance Level  Install Date-----------------------------  -------------------------------------  ------  ----------------  ------------bcm-mpi3                       8.8.1.0.0.0-1OEM.700.1.0.15843807      BCM     VMwareCertified   2024-11-01bnxtnet                        229.0.146.0-1OEM.700.1.0.15843807      BCM     VMwareCertified   2024-11-01bnxtroce                       229.0.146.0-1OEM.700.1.0.15843807      BCM     VMwareCertified   2024-11-01dell-shared-perc8              06.806.92.00-1OEM.700.1.0.15843807     BCM     VMwareCertified   2024-11-01lsi-mr3                        7.722.02.00-1OEM.700.1.0.15843807      BCM     VMwareCertified   2024-11-01lsi-msgpt35                    24.00.00.00-1OEM.700.1.0.15843807      BCM     VMwareCertified   2024-11-01dell-configuration-vib         7.0.0-A06                              DEL     PartnerSupported  2024-11-01dell-fac-dcui                  7.0.3-A03                              DEL     PartnerSupported  2024-11-01dell-fist-util                 5.2.3-2023.03.20                       DEL     PartnerSupported  2024-11-01dell-osname-idrac              7.0.0-A02                              DEL     PartnerSupported  2024-11-01lpfc                           14.2.567.0-1OEM.700.1.0.15843807       EMU     VMwareCertified   2024-11-01i40en                          2.5.11.0-1OEM.700.1.0.15843807         INT     VMwareCertified   2024-11-01icen                           1.12.5.0-1OEM.702.0.0.17630552         INT     VMwareCertified   2024-11-01igbn                           1.11.2.0-1OEM.700.1.0.15843807         INT     VMwareCertified   2024-11-01irdman                         1.4.3.0-1OEM.700.1.0.15843807          INT     VMwareCertified   2024-11-01ixgben-ens                     1.9.2.0-1OEM.700.1.0.15843807          INT     VMwareCertified   2024-11-01ixgben                         1.15.1.0-1OEM.700.1.0.15843807         INT     VMwareCertified   2024-11-01nmlx5-core                     4.22.73.1004-1OEM.703.0.0.18644231     MEL     VMwareCertified   2024-11-01nmlx5-rdma                     4.22.73.1004-1OEM.703.0.0.18644231     MEL     VMwareCertified   2024-11-01qlnativefc                     5.3.82.0-1OEM.703.0.0.18644231         MVL     VMwareCertified   2024-11-01qcnic                          2.0.66.0-1OEM.700.1.0.15843807         QLC     VMwareCertified   2024-11-01qedentv                        3.70.52.0-1OEM.700.1.0.15843807        QLC     VMwareCertified   2024-11-01qedf                           2.74.1.0-1OEM.700.1.0.15843807         QLC     VMwareCertified   2024-11-01qedi                           2.74.1.0-1OEM.700.1.0.15843807         QLC     VMwareCertified   2024-11-01qedrntv                        3.70.50.0-1OEM.700.1.0.15843807        QLC     VMwareCertified   2024-11-01qfle3                          1.4.46.0-1OEM.700.1.0.15843807         QLC     VMwareCertified   2024-11-01qfle3f                         2.1.33.0-1OEM.700.1.0.15843807         QLC     VMwareCertified   2024-11-01qfle3i                         2.1.14.0-1OEM.700.1.0.15843807         QLC     VMwareCertified   2024-11-01atlantic                       1.0.3.0-8vmw.703.0.20.19193900         VMW     VMwareCertified   2024-11-01brcmfcoe                       12.0.1500.2-3vmw.703.0.20.19193900     VMW     VMwareCertified   2024-11-01elxiscsi                       12.0.1200.0-9vmw.703.0.20.19193900     VMW     VMwareCertified   2024-11-01elxnet                         12.0.1250.0-5vmw.703.0.20.19193900     VMW     VMwareCertified   2024-11-01iavmd                          2.7.0.1157-3vmw.703.0.105.22348816     VMW     VMwareCertified   2024-11-01ionic-en                       16.0.0-16vmw.703.0.20.19193900         VMW     VMwareCertified   2024-11-01iser                           1.1.0.1-1vmw.703.0.50.20036589         VMW     VMwareCertified   2024-11-01lpnic                          11.4.62.0-1vmw.703.0.20.19193900       VMW     VMwareCertified   2024-11-01lsi-msgpt2                     20.00.06.00-4vmw.703.0.20.19193900     VMW     VMwareCertified   2024-11-01lsi-msgpt3                     17.00.12.00-2vmw.703.0.105.22348816    VMW     VMwareCertified   2024-11-01mtip32xx-native                3.9.8-1vmw.703.0.20.19193900           VMW     VMwareCertified   2024-11-01ne1000                         0.9.0-1vmw.703.0.50.20036589           VMW     VMwareCertified   2024-11-01nenic                          1.0.33.0-1vmw.703.0.20.19193900        VMW     VMwareCertified   2024-11-01nfnic                          4.0.0.70-1vmw.703.0.20.19193900        VMW     VMwareCertified   2024-11-01nhpsa                          70.0051.0.100-4vmw.703.0.20.19193900   VMW     VMwareCertified   2024-11-01nmlx4-core                     3.19.16.8-2vmw.703.0.20.19193900       VMW     VMwareCertified   2024-11-01nmlx4-en                       3.19.16.8-2vmw.703.0.20.19193900       VMW     VMwareCertified   2024-11-01nmlx4-rdma                     3.19.16.8-2vmw.703.0.20.19193900       VMW     VMwareCertified   2024-11-01ntg3                           4.1.9.0-5vmw.703.0.90.21686933         VMW     VMwareCertified   2024-11-01nvme-pcie                      1.2.3.16-3vmw.703.0.105.22348816       VMW     VMwareCertified   2024-11-01nvmerdma                       1.0.3.5-1vmw.703.0.20.19193900         VMW     VMwareCertified   2024-11-01nvmetcp                        1.0.0.3-1vmw.703.0.125.23794027        VMW     VMwareCertified   2024-11-01nvmxnet3-ens                   2.0.0.22-1vmw.703.0.20.19193900        VMW     VMwareCertified   2024-11-01nvmxnet3                       2.0.0.30-1vmw.703.0.20.19193900        VMW     VMwareCertified   2024-11-01pvscsi                         0.1-4vmw.703.0.20.19193900             VMW     VMwareCertified   2024-11-01qflge                          1.1.0.11-1vmw.703.0.20.19193900        VMW     VMwareCertified   2024-11-01rste                           2.0.2.0088-7vmw.703.0.20.19193900      VMW     VMwareCertified   2024-11-01sfvmk                          2.4.0.2010-6vmw.703.0.20.19193900      VMW     VMwareCertified   2024-11-01smartpqi                       70.4149.0.5000-1vmw.703.0.20.19193900  VMW     VMwareCertified   2024-11-01vmkata                         0.1-1vmw.703.0.20.19193900             VMW     VMwareCertified   2024-11-01vmkfcoe                        1.0.0.2-1vmw.703.0.20.19193900         VMW     VMwareCertified   2024-11-01vmkusb                         0.1-8vmw.703.0.85.21424296             VMW     VMwareCertified   2024-11-01vmw-ahci                       2.0.11-3vmw.703.0.125.23794027         VMW     VMwareCertified   2024-11-01bmcal                          7.0.3-0.125.23794027                   VMware  VMwareCertified   2024-11-01cpu-microcode                  7.0.3-0.125.23794027                   VMware  VMwareCertified   2024-11-01crx                            7.0.3-0.125.23794027                   VMware  VMwareCertified   2024-11-01elx-esx-libelxima.so           12.0.1200.0-4vmw.703.0.20.19193900     VMware  VMwareCertified   2024-11-01esx-base                       7.0.3-0.125.23794027                   VMware  VMwareCertified   2024-11-01esx-dvfilter-generic-fastpath  7.0.3-0.125.23794027                   VMware  VMwareCertified   2024-11-01esx-ui                         2.13.2-22721163                        VMware  VMwareCertified   2024-11-01esx-update                     7.0.3-0.125.23794027                   VMware  VMwareCertified   2024-11-01esx-xserver                    7.0.3-0.125.23794027                   VMware  VMwareCertified   2024-11-01esxio-combiner                 7.0.3-0.125.23794027                   VMware  VMwareCertified   2024-11-01gc                             7.0.3-0.125.23794027                   VMware  VMwareCertified   2024-11-01loadesx                        7.0.3-0.125.23794027                   VMware  VMwareCertified   2024-11-01lsuv2-hpv2-hpsa-plugin         1.0.0-3vmw.703.0.20.19193900           VMware  VMwareCertified   2024-11-01lsuv2-intelv2-nvme-vmd-plugin  2.7.2173-1vmw.703.0.20.19193900        VMware  VMwareCertified   2024-11-01lsuv2-lsiv2-drivers-plugin     1.0.0-12vmw.703.0.50.20036589          VMware  VMwareCertified   2024-11-01lsuv2-nvme-pcie-plugin         1.0.0-1vmw.703.0.20.19193900           VMware  VMwareCertified   2024-11-01lsuv2-oem-dell-plugin          1.0.0-1vmw.703.0.20.19193900           VMware  VMwareCertified   2024-11-01lsuv2-oem-hp-plugin            1.0.0-1vmw.703.0.20.19193900           VMware  VMwareCertified   2024-11-01lsuv2-oem-lenovo-plugin        1.0.0-1vmw.703.0.20.19193900           VMware  VMwareCertified   2024-11-01lsuv2-smartpqiv2-plugin        1.0.0-9vmw.703.0.105.22348816          VMware  VMwareCertified   2024-11-01native-misc-drivers            7.0.3-0.125.23794027                   VMware  VMwareCertified   2024-11-01trx                            7.0.3-0.125.23794027                   VMware  VMwareCertified   2024-11-01vdfs                           7.0.3-0.125.23794027                   VMware  VMwareCertified   2024-11-01vmware-esx-esxcli-nvme-plugin  1.2.0.44-1vmw.703.0.20.19193900        VMware  VMwareCertified   2024-11-01vsan                           7.0.3-0.125.23794027                   VMware  VMwareCertified   2024-11-01vsanhealth                     7.0.3-0.125.23794027                   VMware  VMwareCertified   2024-11-01tools-light                    12.3.5.22544099-23794019               VMware  VMwareCertified   2024-11-01

第4步,可以使用grep命令筛选出指定范围的软件包,比如按软件供应商的名称

[root@VMNote:~] esxcli software vib list | grep DELdell-configuration-vib         7.0.0-A06                              DEL     PartnerSupported  2024-11-01dell-fac-dcui                  7.0.3-A03                              DEL     PartnerSupported  2024-11-01dell-fist-util                 5.2.3-2023.03.20                       DEL     PartnerSupported  2024-11-01dell-osname-idrac              7.0.0-A02                              DEL     PartnerSupported  2024-11-01[root@VMNote:~]

第5步,确定要删除的软件包后,使用esxcli software vib remove命令来删除软件包。例如,要删除名为dell-configuration-vib 和 dell-osname-idrac 的软件包

[root@VMNote:~] esxcli software vib remove -n=dell-configuration-vib
Removal Result Message: The update completed successfully, but the system needs to be rebooted for the changes to be effective.
Reboot Required: true
VIBs Installed: VIBs Removed: DEL_bootbank_dell-configuration-vib_7.0.0-A06 VIBs Skipped:[root@VMNote:~] esxcli software vib remove -n=dell-osname-idrac
Removal Result Message: The update completed successfully, but the system needs to be rebooted for the changes to be effective.
Reboot Required: true
VIBs Installed: VIBs Removed: DEL_bootbank_dell-osname-idrac_7.0.0-A02   VIBs Skipped:

第6步,根据删除结果提示要重启,使用reboot命令重启ESXi主机

注意:有些核心软件包或者正在被系统关键进程使用的软件包可能无法删除,系统会给出相应的错误提示,说明无法删除的原因。

[root@VMNote:~] reboot

第7步,ESXi主机重启完毕后,使用esxcli software vib list 命令确认软件包删除成功

[root@VMNote:~]  esxcli software vib list | grep DELdell-fac-dcui                  7.0.3-A03                              DEL     PartnerSupported  2024-11-01dell-fist-util                 5.2.3-2023.03.20                       DEL     PartnerSupported  2024-11-01[root@VMNote:~]

有VM问题需要协助?

免费试用VMware技术助理(已接Deepseek)!即时解答VM难题

→ 🤖VM技术助理

解析和诊断各类vCenter错误,ESXi日志,虚拟机vmware.log

→ 📕VMware日志分析器

图书推介 - 京东自营

24小时热门

还有更多VMware问题?

免费试下我们的VMware技术助理(已接Deepseek)!即时解答VM难题 → 🤖VM技术助理

试试 📕VMware日志分析器 免费诊断各类vCenter错误,ESXi日志,虚拟机vmware.log等等

########

扫码加入VM资源共享交流微信群(请备注加群

需要协助?或者只是想技术交流一下,直接联系我们!

推荐更多

vCenter Server Appliance 6.7 部署在 firstboot 期间失败
运维必备

vCenter Server Appliance 6.7 部署在 firstboot 期间失败

vCenter Server Appliance 6.7 部署在 firstboot 期间失败。vCenter Server Appliance 6.7 部署在 firstboot 期间失败,提示更新管理器扩展注册失败?本文介绍根本原因和完整的解决方法。 本文针对该问题提供了深度剖析与实测解决方案。

一些VMware ESXi 虚拟机性能问题故障排除指南
运维必备

一些VMware ESXi 虚拟机性能问题故障排除指南

ESX/ESXi 虚拟机性能问题故障排除指南。ESX/ESXi 虚拟机性能不佳?本文提供完整的故障排除指南,包括 CPU、内存、存储和网络性能问题的诊断方法。 本文针对该问题提供了深度剖析与实测解决方案。

NSX 覆盖网络上的虚拟机无法 ping DNS 服务器和解析名称
运维必备

NSX 覆盖网络上的虚拟机无法 ping DNS 服务器和解析名称

NSX 覆盖网络上的虚拟机无法 ping DNS 服务器和解析名称。NSX 覆盖网络上的虚拟机无法 ping DNS 服务器和解析名称?本文介绍根本原因和完整的解决方法。 本文针对该问题提供了深度剖析与实测解决方案。

vLCM 无法解压缩更新文件的解决方法
运维必备

vLCM 无法解压缩更新文件的解决方法

vLCM 无法解压缩更新文件的解决方法。vLCM 导入更新文件时在 20% 失败,提示无法解压缩包?本文介绍根本原因和完整的解决方法。 本文针对该问题提供了深度剖析与实测解决方案。

//omg10.com/4/9119499