Uninstalling plugins from CloudBees CI

2 minute read

When a plugin is no longer used in a CloudBees CI environment, it should be removed either from operations center or from the appropriate controller. Removing unused plugins reduces memory overhead at boot or runtime, reduces configuration options in the web UI, and removes the potential for future conflicts with new plugin updates. You have two choices when removing plugins; uninstall or disable. For more information on disabling plugins see Disabling plugins from CloudBees CI.

Uninstalling a plugin removes the plugin binary (*.jpi or *.hpi) from the disk. The plugin continues to function normally until you restart Jenkins, but once you restart, Jenkins will function as if you didn’t have the plugin to begin with. Uninstalled plugins will not appear anywhere in the UI, and all the extensions they contributed will disappear.

Uninstalling plugins

To uninstall a plugin using the web UI:
  1. From the operations center or the appropriate controller, select Manage Jenkins.

  2. Select Manage Plugins.

  3. Select the Installed tab.

  4. Find the plugin you want to uninstall.

    They are listed in alphabetical order.
  5. Select Uninstall to the left of the plugin you want to uninstall.

    If the plugin is safe to uninstall and is not a dependency for other plugins, a selectable Uninstall button displays to the left of the plugin.

A plugin may also be uninstalled by removing the corresponding .hpi file from the JENKINS_HOME/plugins directory on the controller. The plugin will continue to function until the controller has been restarted.

If a plugin .hpi file is removed but required by other plugins, the controller may fail to boot correctly.

Uninstalling a plugin does not remove the configuration(s) that the plugin may have created. If there are existing job/node/view/build. configurations that reference data created by the uninstalled plugin, during startup Jenkins will warn that some configurations could not be fully loaded and ignore the unrecognized data.

Configuration(s) are preserved until they are overwritten, so if the plugin is reinstalled, the configuration values reappear.

To purge uninstalled plugin configurations:
  1. From the operations center or the appropriate controller, select the Manage Jenkins area.

  2. Select Manage Old Data to review and remove old data.

Uninstalling a plugin via a cluster operation

You can uninstall plugins using a cluster operation that affects multiple client controllers and update centers. For more information about cluster operations, refer to Cluster operations.

To uninstall plugins using a cluster operation:
  1. Find the plugin id on the controller using the following script in the Script Console:

    Jenkins.instance.pluginManager.plugins.each{ plugin -> println (" Display Name: ${plugin.getDisplayName()}, Plugin Id: ${plugin.getShortName()}") }
  2. Once you have the plugin ID, you can uninstall the plugin using the following script in a Cluster Operation:

    String pluginId = "mock-security-realm" def plugin = Jenkins.getInstance().getPluginManager().getPlugin(pluginId) plugin.doDoUninstall() return "Plugin uninstalled"
    In the above example, the mock-security-realm plugin will be uninstalled.

The plugin will be removed completely after the controller is restarted.