如何使用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:~]

图书推介 - 京东自营

24小时热门

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

推荐更多

如何将ESXi主机置于或退出维护模式?
运维必备

如何将ESXi主机置于或退出维护模式?

本文介绍了三种将ESXi主机置于维护模式或退出维护模式的方法。分别通过vSphere客户端、ESXi主机客户端和命令行界面(CLI)进行操作。每种方法都提供了详细的步骤,帮助系统管理员有效地管理ESXi主机的维护工作。

戴尔OEM版ESXi安装包与VMware原版安装包有何不同?
VMware快速入门

戴尔OEM版ESXi安装包与VMware原版安装包有何不同?

这篇文章对比了Dell OEM版本和VMware原厂版本的ESXi安装包,重点分析了驱动集成、功能定制和版本发布时效等方面的差异。Dell OEM版本为Dell服务器定制了专门的驱动程序,提供更好的硬件兼容性和更简便的安装过程。而VMware原厂版本则适用于更广泛的硬件,更新发布更为及时。通过这些比较,用户可以根据自身需求选择更合适的ESXi版本。

如何备份VMware vCenter Server Appliance(VCSA)的文件
VMware快速入门

如何备份VMware vCenter Server Appliance(VCSA)的文件

本文以vCenter Server Appliance 7.0(VCSA 7.0)为例,详细介绍了如何通过自动备份和手动备份两种方式,对VCSA进行文件级别的备份配置,确保数据安全和业务连续性。内容涵盖备份前的准备工作、操作步骤及注意事项,为管理员提供了实用的参考指南。

VMware快速入门

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

这篇文章介绍了如何在VMware ESXi上移除VIB包,VIB包是用于扩展ESXi功能的软件组件。通过正确的方法删除不需要的VIB包,可以帮助优化系统性能并确保兼容性。