diff --git a/tasks/linux.sh b/tasks/linux.sh index 93ad473..0dab975 100755 --- a/tasks/linux.sh +++ b/tasks/linux.sh @@ -109,8 +109,9 @@ case "$available_manager" in # yum install and rpm -q may produce different results because one package may provide another # For example, 'vim' can be installed because the 'vim-enhanced' package provides 'vim' - # So, find out the exact package to get the status for - provided_package="$(rpm -q --whatprovides "$name")" || provided_package= + # So, find out the exact package to get the status for. Ensure the results are de-duplicated + # for packages which may match the whatprovides query more than once. + provided_package="$(rpm -q --whatprovides "$name" | sort -u)" || provided_package= # - is the syntax for installing a specific version in yum [[ $version ]] && full_name="${name}-${version}" || full_name="${name}"