Uninstalling CloudBees CD/RO on Linux, UNIX, or macOS

3 minute readReference

Use the following procedures to uninstall CloudBees CD/RO completely from a Linux, UNIX, or macOS server, web server, agent, or developer machine.

You can uninstall agents using any of the following accounts:

  • root

  • Any account with sudo privileges

  • (UNIX or macOS only) Any non-root account without sudo privileges

Uninstalling CloudBees CD/RO Using root or an Account with sudo Privileges

  1. Log in as root or using an account with sudo privileges.

  2. Run one of the following commands:

    • Linux: /opt/cloudbees/sda/uninstall

    • UNIX or macOS: /opt/cloudbees/sda/uninstaller/uninstall

The following prompt appears:

This will completely remove CloudBees CD/RO from your system. Are you sure you want to do this? [y/N]

If you did not invoke the uninstaller as root, the following prompt appears:

  • Linux: /Root Required: You must be root to run uninstall this application.

  • UNIX or macOS: /opt/cloudbees/sda/uninstaller/uninstall must be run as root or use --nonRoot switch for non-root user.

    1. Enter y to start the uninstallation.

The following prompts appear:

Uninstalling CloudBees CD/RO…​

Uninstall complete.

  1. If you will be reinstalling CloudBees CD/RO, remove any remaining files from the /opt/cloudbees/sda directory.

    The uninstaller does not remove the files in this directory that CloudBees CD/RO created or modified after the initial installation. You should relocate the files if you need them for troubleshooting.

Uninstalling UNIX or macOS CloudBees CD/RO Agents Using a Non-root Account

A non-root account is one that is not root and also does not have sudo privileges.

Running the uninstaller without root or sudo privileges is not recommended. When run without root or sudo privileges, the installer cannot remove the files that provide automatic start for the agent services as well as other files as described below.

To use a non-root account to uninstall UNIX or macOS CloudBees CD/RO agents:

  1. Log in as the agent service user.

    This is the user that owns the installed agent files and runs the agent processes. This user was specified during installation with root or sudo privileges or is the user that performed the non-root, non- sudo installation. You can find this user by entering ls -l <install_dir>.

  2. Enter /opt/cloudbees/sda/uninstall --nonRoot.

The following prompt appears:

This will completely remove CloudBees CD/RO from your system. Are you sure you want to do this? [y/N]
  1. Enter y to start the uninstallation.

If you lack sufficient privileges on the installation directory, the following error appears, and you must obtain sufficient privileges before continuing:

Error: insufficient privileges to uninstall the CloudBees CD/RO agent which is located in directory:
 /opt/cloudbees/sda

If you have sufficient privileges on the installation directory, the following prompts appear:

Found /opt/cloudbees/sda/MANIFEST, please wait while files are deleted

Uninstall completed.  Files backed up to /opt/cloudbees/sda

Uninstall was performed in the non-root mode.
Please manually remove the CloudBees CD/RO services from system auto-start.

The uninstaller displays the following errors if control files for the agent service exist in /Library/LaunchDaemons/ on macOS or in /etc/ on other platforms:

rm: cannot remove '/etc/rc.d/init.d/ecmdrAgent': Permission denied
rm: cannot remove '/etc/rc.d/rc2.d/S99ecmdrAgent': Permission denied
rm: cannot remove '/etc/rc.d/rc2.d/S99ecmdrAgent': Permission denied

If the uninstallation is successful, the uninstaller exits with the following prompts:

Uninstall completed.  Files backed up to /opt/cloudbees/sda

Uninstall was performed in the non-root mode.
Please manually remove the CloudBees CD/RO services from system auto-start.
  1. If you will be reinstalling CloudBees CD/RO agents, remove any remaining files from the /opt/cloudbees/sda directory.

    The uninstaller does not remove the files in this directory that CloudBees CD/RO created or modified after the initial installation. You should relocate the files if you need them for troubleshooting.

  2. If you will be reinstalling CloudBees CD/RO agents, delete the control files for the agent service manually to avoid errors.

    A non-root uninstallation does not delete these files. The files are in /Library/LaunchDaemons/ on macOS and in /etc/ on other platforms.