From bccfcbcab012e29292849f97c4efa93e3d8788d0 Mon Sep 17 00:00:00 2001 From: Kaniska Date: Thu, 30 Oct 2025 06:53:00 +0000 Subject: [PATCH] [common-utils] - Corrections in the installation of jq --- src/common-utils/devcontainer-feature.json | 2 +- src/common-utils/main.sh | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/common-utils/devcontainer-feature.json b/src/common-utils/devcontainer-feature.json index 14850232d..bc57e3b44 100644 --- a/src/common-utils/devcontainer-feature.json +++ b/src/common-utils/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "common-utils", - "version": "2.5.4", + "version": "2.5.5", "name": "Common Utilities", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/common-utils", "description": "Installs a set of common command line utilities, Oh My Zsh!, and sets up a non-root user.", diff --git a/src/common-utils/main.sh b/src/common-utils/main.sh index 68abe58c8..030995910 100644 --- a/src/common-utils/main.sh +++ b/src/common-utils/main.sh @@ -172,7 +172,7 @@ install_redhat_packages() { else echo "Unable to find 'tdnf', 'dnf', or 'yum' package manager. Exiting." exit 1 -fi + fi if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then package_list="${package_list} \ @@ -228,7 +228,7 @@ fi fi # Install EPEL repository if needed (required to install 'jq' for CentOS) - if ! ${install_cmd} -q list jq >/dev/null 2>&1; then + if [[ "${ID}" = "centos" ]] && ! rpm -q jq >/dev/null 2>&1; then ${install_cmd} -y install epel-release remove_epel="true" fi @@ -240,11 +240,18 @@ fi fi if [ -n "${package_list}" ]; then - ${install_cmd} -y install ${package_list} + echo "Packages to verify are installed: ${package_list}" + echo "Running ${install_cmd} install..." + if [ "${install_cmd}" = "dnf" ]; then + ${install_cmd} -y install --allowerasing ${package_list} + else + ${install_cmd} -y install ${package_list} + fi fi # Get to latest versions of all packages if [ "${UPGRADE_PACKAGES}" = "true" ]; then + echo "Running ${install_cmd} upgrade..." ${install_cmd} upgrade -y fi