SPDX-FileCopyrightText: (C) 2026 Intel Corporation
SPDX-License-Identifier: Apache-2.0
name: update-install-packages description: Update Ubuntu package configuration files for package add/delete operations.
Trigger Phrases
- update install packages
- add package to auto-install-pkgs
- delete package from ict template
- modify ubuntu package list
- update-install-packages
- add missing packages
- install hardware packages
- add hardware drivers
- install device drivers
- manage system packages
- configure package list
- add kernel drivers
- install missing dependencies
Required Inputs
- enib_home: absolute path to this repository root
- package_operation:
add|delete - packages_list: comma-separated package names
- target_config_file:
auto-install-pkgs|ict-template|both
Preconditions
- Repository exists and is writable:
test -d <enib_home> && test -w <enib_home> - Target files exist:
test -f <enib_home>/infrastructure/host-os/auto-install-pkgs.yamltest -f <enib_home>/infrastructure/host-os/ict/ubuntu24-x86_64-minimal-ptl.yml
-
package_operationis one ofadd|delete. -
target_config_fileis one ofauto-install-pkgs|ict-template|both. -
packages_listis not empty. - Validate each package name format (letters, digits,
.,+,-) and reject invalid tokens. - MANDATORY: Verify package availability in Ubuntu 24.04 repositories for each requested package using
apt-cache show <package_name>. If package not found, useapt-cache search <keyword>to find alternatives and present to user for selection. - Create backup copies before modifying configuration files.
- Prompt for
sudoconfirmation only before privileged or destructive operations. - Sudo probe (MANDATORY before any privileged step such as sudo apt update/sudo apt install): run sudo -n true. If exit is non-zero, stop and instruct the user to run sudo -v in their terminal (or add a scoped NOPASSWD entry in /etc/sudoers.d/ for the specific binary), then re-trigger the skill. If sudo -v was already run but sudo -n true still fails, the user must make sudo timestamps global (tty_tickets issue): echo 'Defaults timestamp_type=global' | sudo tee /etc/sudoers.d/agent-timestamp && sudo chmod 0440 /etc/sudoers.d/agent-timestamp && sudo visudo -c. See AGENTS.md.
Steps
- Collect required inputs:
package_operation,packages_list, andtarget_config_file.- Split and normalize
packages_listinto individual package names. - Optionally collect hardware details (e.g., device name, model, vendor).
- Validate operation and package list:
- Reject invalid operation/target values.
- Reject invalid package name formats.
- CRITICAL: Verify package availability in Ubuntu 24.04 repositories using
apt-cache show <package_name>. - For
addoperations: MANDATORY - Query Ubuntu 24.04 apt repositories usingapt-cache show <package_name>to confirm each package exists before adding to target_config_file. If a package is not found, suggest alternative package names usingapt-cache search <keyword>and present options to the user. Reject any packages not found in official Ubuntu 24.04 repositories after validation.
- If hardware details provided, search Ubuntu 24.04 repositories:
- Query repository metadata for corresponding userspace or kernel-space packages matching the hardware device.
- Return matched packages to user for confirmation before adding to
packages_list. - Merge confirmed packages with the original
packages_list.
- Run preconditions and create backups:
- Backup
infrastructure/host-os/auto-install-pkgs.yamland/orinfrastructure/host-os/ict/ubuntu24-x86_64-minimal-ptl.ymlbefore modification.
- Update target configuration files based on
target_config_file:
auto-install-pkgs: updatehost-os/auto-install-pkgs.yaml.ict-template: updatehost-os/ict/ubuntu24-x86_64-minimal-ptl.yml.both: update both files.
- If adding more packages in
host-os/auto-install-pkgs.yaml, add only the cumulative package size to existingDISK_SIZEinhost-os/prepare-host-img.shwhen cumulative package size exceeds 1GB. Do not increment disk size for packages under 1GB (existing disk allocation already includes future headroom). - For packages that depend on kernel (performance tools, kernel drivers, or userspace packages with kernel dependencies), create symbolic links to the custom Intel kernel inside
infrastructure/installation-scripts/setup-kernel-depended-pkgs.shas a workaround. Do not startsetup-kernel-depended-pkgs.shif updated as part ofauto-install-pkgs.yamlandubuntu24-x86_64-minimal-ptl.yml; this script will start during the provisioning process separately. - Validate updated YAML syntax for modified files.
- Summarize package update results for each modified file.
- If user asks for artifact packaging, hand off to the dedicated packaging skill.
Validation
- Configuration update summary is complete for add/delete operations.
- Updated YAML files parse successfully.
- Backup files exist for each modified config file.
Rollback
- Restore modified configuration files from backups if update or validation fails.
Safety Rules
- Stop on failed preconditions.
- Backup configuration files before modification.
- Validate YAML syntax after updates.
- Ask before privileged or destructive actions.
- Ask for
sudoconfirmation only before privileged or destructive operations. - Never infer credentials, certificates, SSH keys, or secrets.
- Stop on precondition or validation failure and provide next-action guidance.
- Do not overwrite ICT source template; always copy to working template.
- Verify package availability in Ubuntu 24.04 repositories.
Expected Result Summary
Return:
- whether preconditions passed
- requested package operation and normalized package list
- target files selected and backup file paths
- per-file package change results (added/deleted/already-present/not-found)
- YAML validation status
- whether packaging handoff was requested
- troubleshooting hints when package update fails (for example validation, permissions, or repository metadata issues)
Troubleshooting Notes
- Package Not Found: If
apt-cache show <package>returns nothing, the package name is incorrect or the package doesn't exist. Useapt-cache search <keyword>to find the correct package name. Common issues:- Different naming conventions: check for suffixes like
-dev,-tools, or version numbers - Package might be in a different repository (Intel overlay, third-party PPA)
- Different naming conventions: check for suffixes like
- If package validation fails, confirm package names against Ubuntu 24.04 repository metadata and retry.
- If YAML validation fails, restore from backup and reapply package updates with corrected formatting.
- If file update fails, verify write permissions for target files and backup paths.