Uninstalling plugins from CloudBees Core

When a plugin is no longer used in a CloudBees Core environment, it should be removed either from Operations Center or from the appropriate master. 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.

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 Master, select the Manage Jenkins area.

  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 the Uninstall button 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 master. The plugin will continue to function until the master has been restarted.

If a plugin .hpi file is removed but required by other plugins, the master 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/etc. 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 Master, 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 masters and update centers. For more information about cluster operations, see Cluster operations.

To uninstall plugins using a cluster operation:
  1. Find the plugin id on the master 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()
    In the above example, the plugin mock-security-realm will be uninstalled.

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