feat: apt package filter

This commit is contained in:
2024-03-07 01:43:05 +00:00
parent d8c4d07a8e
commit f638492ce6

View File

@@ -13,9 +13,11 @@ if command -v apt-get &> /dev/null; then
) )
sudo apt-get update sudo apt-get update
sudo apt-get install -qq "${apt_packages[@]}"
sudo apt-get autoremove apt_packages=($(comm -13 <(printf "%s\n" "${apt_packages[@]}" | sort) <(dpkg --get-selections | awk '{print $1}' | sort)))
sudo apt-get autoclean if [ ${#apt_packages[@]} -gt 0 ]; then
sudo apt-get install -qq "${apt_packages[@]}"
fi
unset apt_packages unset apt_packages
fi fi