diff --git a/.chezmoiscripts/run_onchange_before_linux-install-packages.sh.tmpl b/.chezmoiscripts/run_onchange_before_linux-install-packages.sh.tmpl index 052dc8e..9ec55ff 100644 --- a/.chezmoiscripts/run_onchange_before_linux-install-packages.sh.tmpl +++ b/.chezmoiscripts/run_onchange_before_linux-install-packages.sh.tmpl @@ -72,14 +72,14 @@ for package in "${pacmanForce_packages[@]}"; do to_install_pacmanForce+=("$package") done -sudo pacman -Sy - # 等待鎖定檔案被移除 wait_for_pacman_unlock if [[ ${#to_install_pacmanForce[@]} -gt 0 ]]; then echo " - Installing missing packages via pacman: ${to_install_pacmanForce[@]}" - sudo pacman -S --needed --noconfirm "${to_install_pacmanForce[@]}" + sudo pacman -Sy --needed --noconfirm "${to_install_pacmanForce[@]}" +else + sudo pacman -Sy fi # 等待鎖定檔案被移除