To resolve issues related to outdated or vulnerable sudo versions on Ubuntu 22-based gateways.
You can update the sudo OS package using either of the following methods:
- Method 1: Using OpsRamp Agent Remote Script (Recommended)
 - Method 2: Manual Execution (for Classic or NextGen Gateways)
 
Method 1: Using OpsRamp Agent Remote Script
- Navigate to Automation > Scripts v2.
 - Create a Script Category (Global, Partner-specific, or Client-specific).
 - Click the Add to create a new script. Provide the following script details:
- Name: sudo-package-upgrade
 - Description: Patch script to update sudo
 - Execution Time: 60 seconds
 - Platform: Linux
 
 - Paste this following script in the script content:
#!/bin/bash set -ex # Define working directory WORKDIR="/tmp" PATCH_ARCHIVE="sudo-patch.tar.gz" PATCH_FOLDER="sudo-patch" # Move to working directory cd "$WORKDIR" # Download the patch archive wget -q "https://opsramp-gateway.s3.us-east-2.amazonaws.com/patching/ubuntu22/vg-1900-UB22-Patch/$PATCH_ARCHIVE" # Extract the archive tar -xvzf "$PATCH_ARCHIVE" # Navigate into the extracted folder cd "$PATCH_FOLDER" # Run the build script if [ -f build.sh ]; then bash build.sh else echo "Error: build.sh not found in $PATCH_FOLDER" exit 1 fi # Check installed sudo package dpkg -l | grep sudo || echo "sudo package not found" - Save the script
 - Schedule the script execution:
- Select the script
 - Click 
Schedule(right panel) - Fill in details:
- Schedule Name
 - Target Resource(s)
 - Schedule Type: 
One-time 
 - Click Save.
 
 - Run the Scheduled Script from the Scheduled Script section.
 - Review Execution Logs from the right-side panel for the status.
 
Method 2: Manual Execution (for Classic or NextGen Gateways)
Use this if Agent based execution isn’t possible.
Prerequisites
- Access to the gateway system
 - Appropriate user credentials (ruser for classic gateway, gateway-admin for nextgen-gw)
 - Ubuntu 22 operating system
 
Steps for Manual Execution:
- Login to Gateway using:
ruserif classic gatewaygateway-adminif nextgen-gw running with Ubuntu 22 only
 - Take root access by using the following command and enter password:
 
sudo su -3. Run the following command to change directory:cd /tmp/4. Download the Patch File:- Using patch link: https://opsramp-gateway.s3.us-east-2.amazonaws.com/patching/ubuntu22/vg-1900-UB22-Patch/sudo-patch.tar.gz
 - Or using command:
wget https://opsramp-gateway.s3.us-east-2.amazonaws.com/patching/ubuntu22/vg-1900-UB22-Patch/sudo-patch.tar.gz 
- Untar the downloaded file using the following command:
 
tar -xvzf sudo-patch.tar.gz6. Execute the Patch ScriptSwitch to the directory and run the script using the following commands:
cd sudo-patch
sh build.sh7. Verify InstallationRun the following command to see the installed sudo package versions:
dpkg -l | grep sudoNote
The expected version of sudo is1.9.9-1ubuntu2.5.