Chapter 15. Managing packages You can use Satellite to install, upgrade, and remove packages on hosts, as well as to enable or disable repositories on hosts. 15.1. Enabling and disabling repositories on hosts Use this procedure to enable and disable repositories on hosts for Satellite. Procedure In the Satellite web UI, navigate to Hosts > All Hosts , Select the host name. Click the Content tab. Click the Repository Sets tab. Click the vertical ellipsis to choose Override to disabled or Override to enabled to disable or enable repositories on hosts. 15.2. Installing packages on a host Use this procedure to review and install packages on a host using the Satellite web UI. The list of packages available for installation depends on the content view and lifecycle environment assigned to the host. Procedure In the Satellite web UI, navigate to Hosts > All Hosts and select the host you want to install packages on. On the Content tab, select the Packages tab. On the vertical ellipsis icon to the upgrade button, click Install Packages . In the Install packages window, select the package or packages that you want to install on the host. Click Install . By default, the packages are installed using remote execution. For more information about running remote execution jobs, see Configuring and Setting up Remote Jobs in Managing hosts . Create a body of the API request in the JSON format by following the instructions below. API procedure Create the "job_invocation" object and place rest of the body inside this object. Create the "inputs" object with the "package" field of the string type specifying the packages you want to install. If you are specifying multiple packages, separate them with a whitespace. Create a "feature" field of the string type with value "katello_package_install" . Create a "search_query" field of the string type and input a search query matching the hosts on which you want to install the packages. Optional: If you want to install packages as a specific user, create an ssh object with the following fields of the string type: "effective_user" with the name of the ssh user "effective_user_password" with the password of the ssh user if this password is required Optional: If you want to install packages at a later time, create the "scheduling" object. The object can contain one or both of the following fields of the string type with date, time, and a timezone in the ISO 8601 format: "start_at" - sets the time to install the packages "start_before" - sets the latest time to install the packages. If it is not possible to install the packages by this time, then this action is cancelled. If you omit time, it defaults to 00:00:00. If you omit timezone, it defaults to UTC. Optional: If you want to limit the number of hosts on which the job is run concurrently, create the "concurrency_control" object with the "concurrency_level" field of the integer type. Assign the number of hosts as the field value. Optional: If you want to install packages at a later time and you want the host search query to be evaluated at a time of running the job, create a "targeting_type" field of the string type with the "dynamic_query" value. This is useful if you expect the result of the search query to be different at the time of running the job due to changed status of the hosts. If you omit this field, it defaults to "static_query" . Send a POST request with the created body to the /api/job_invocations endpoint of your Satellite Server and use a tool like Python to see a formatted response. Example API request: Verification In the Satellite web UI, navigate to Monitor > Jobs and see the report of the scheduled or completed remote execution job to install the packages on the selected hosts. Example API request body 15.3. Upgrading packages on a host You can upgrade packages on a host in bulk in the Satellite web UI. Procedure In the Satellite web UI, navigate to Hosts > All Hosts . Click the name of the host you want to modify. Click the Content tab, then click the Packages tab. Select Upgradable from the Status list. Select upgrade version from the dropdown menu in Upgradable to column where applicable. Select the packages you want to upgrade. Click Upgrade . You get a REX job notification once the remote execution job is complete. Create a body of the API request in the JSON format by following the instructions below. API procedure Create the "job_invocation" object and place rest of the body inside this object. Create the "inputs" object with the "package" field of the string type specifying the packages you want to update. If you are specifying multiple packages, separate them with a whitespace. Create a "feature" field of the string type with value "katello_package_update" . Create a "search_query" field of the string type and input a search query matching the hosts on which you want to update the packages. Optional: If you want to update packages as a specific user, create an ssh object with the following fields of the string type: "effective_user" with the name of the ssh user "effective_user_password" with the password of the ssh user if this password is required Optional: If you want to update packages at a later time, create the "scheduling" object. The object can contain one or both of the following fields of the string type with date, time, and a timezone in the ISO 8601 format: "start_at" - sets the time to update the packages "start_before" - sets the latest time to update the packages. If it is not possible to update the packages by this time, then this action is cancelled. If you omit time, it defaults to 00:00:00. If you omit timezone, it defaults to UTC. Optional: If you want to limit the number of hosts on which the job is run concurrently, create the "concurrency_control" object with the "concurrency_level" field of the integer type. Assign the number of hosts as the field value. Optional: If you want to update packages at a later time and you want the host search query to be evaluated at a time of running the job, create a "targeting_type" field of the string type with the "dynamic_query" value. This is useful if you expect the result of the search query to be different at the time of running the job due to changed status of the hosts. If you omit this field, it defaults to "static_query" . Send a POST request with the created body to the /api/job_invocations endpoint of your Satellite Server and use a tool like Python to see a formatted response. Example API request: Verification In the Satellite web UI, navigate to Monitor > Jobs and see the report of the scheduled or completed remote execution job to update the packages on the selected hosts. Example API request body 15.4. Removing packages from a host You can remove packages from a host in the Satellite web UI. Procedure In the Satellite web UI, navigate to Hosts > All Hosts . Click the name of the host you want to modify. Click the Content tab, then click the Packages tab. Click the vertical ellipsis for the package you want to remove and select Remove . You get a REX job notification once the remote execution job is complete. Create a body of the API request in the JSON format by following the instructions below. API procedure Create the "job_invocation" object and place rest of the body inside this object. Create the "inputs" object with the "package" field of the string type specifying the packages you want to remove. If you are specifying multiple packages, separate them with a whitespace. Create a "feature" field of the string type with value "katello_package_remove" . Create a "search_query" field of the string type and input a search query matching the hosts on which you want to remove the packages. Optional: If you want to remove packages as a specific user, create an ssh object with the following fields of the string type: "effective_user" with the name of the ssh user "effective_user_password" with the password of the ssh user if this password is required Optional: If you want to remove packages at a later time, create the "scheduling" object. The object can contain one or both of the following fields of the string type with date, time, and a timezone in the ISO 8601 format: "start_at" - sets the time to remove the packages "start_before" - sets the latest time to remove the packages. If it is not possible to remove the packages by this time, then this action is cancelled. If you omit time, it defaults to 00:00:00. If you omit timezone, it defaults to UTC. Optional: If you want to limit the number of hosts on which the job is run concurrently, create the "concurrency_control" object with the "concurrency_level" field of the integer type. Assign the number of hosts as the field value. Optional: If you want to remove packages at a later time and you want the host search query to be evaluated at a time of running the job, create a "targeting_type" field of the string type with the "dynamic_query" value. This is useful if you expect the result of the search query to be different at the time of running the job due to changed status of the hosts. If you omit this field, it defaults to "static_query" . Send a POST request with the created body to the /api/job_invocations endpoint of your Satellite Server and use a tool like Python to see a formatted response. Example API request: Verification In the Satellite web UI, navigate to Monitor > Jobs and see the report of the scheduled or completed remote execution job to remove the packages on the selected hosts. Example API request body

Commands:
curl https:// satellite.example.com /api/job_invocations -H "content-type: application/json" -X POST -d @ Path_To_My_API_Request_Body -u My_Username : My_Password | python3 -m json.tool
{ "job_invocation" : { "concurrency_control" : { "concurrency_level" : 100 }, "feature" : "katello_package_install", "inputs" : { "package" : "nano vim" }, "scheduling" : { "start_at" : "2023-09-21T19:00:00+00:00", "start_before" : "2023-09-23T00:00:00+00:00" }, "search_query" : "*", "ssh" : { "effective_user" : "My_Username", "effective_user_password" : "My_Password" }, "targeting_type" : "dynamic_query" } }
curl https:// satellite.example.com /api/job_invocations -H "content-type: application/json" -X POST -d @ Path_To_My_API_Request_Body -u My_Username : My_Password | python3 -m json.tool
{ "job_invocation" : { "concurrency_control" : { "concurrency_level" : 100 }, "feature" : "katello_package_update", "inputs" : { "package" : "nano vim" }, "scheduling" : { "start_at" : "2023-09-21T19:00:00+00:00", "start_before" : "2023-09-23T00:00:00+00:00" }, "search_query" : "*", "ssh" : { "effective_user" : "My_Username", "effective_user_password" : "My_Password" }, "targeting_type" : "dynamic_query" } }
curl https:// satellite.example.com /api/job_invocations -H "content-type: application/json" -X POST -d @ Path_To_My_API_Request_Body -u My_Username : My_Password | python3 -m json.tool
{ "job_invocation" : { "concurrency_control" : { "concurrency_level" : 100 }, "feature" : "katello_package_remove", "inputs" : { "package" : "nano vim" }, "scheduling" : { "start_at" : "2023-09-21T19:00:00+00:00", "start_before" : "2023-09-23T00:00:00+00:00" }, "search_query" : "*", "ssh" : { "effective_user" : "My_Username", "effective_user_password" : "My_Password" }, "targeting_type" : "dynamic_query" } }