Uninstall 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

To uninstall CloudBees CD/RO using root or an account with sudo privileges:

  1. Sign 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 displays:

      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 displays:

      • 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.

  3. Enter y to start the uninstallation.

    The following prompts display:

    Uninstalling CloudBees CD/RO... Uninstall complete.
  4. If you plan to reinstall 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.

CloudBees does not recommend running the uninstaller without root or sudo privileges. If you run the installer without root or sudo privileges, it cannot remove the files that automatically start 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 displays:

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

    If you lack sufficient privileges on the installation directory, the following error displays, 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 display:

    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 {PRODUCT} services from system auto-start.
  4. If you plan to reinstall 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.

  5. If you plan to reinstall 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.