sh/bash/apt.sh
2024-11-12 06:03:36 +01:00

40 lines
559 B
Bash

apt_clean() {
apt-get \
clean
}
apt_install_backports() {
apt_install_target "${DEBIAN_CODENAME}-backports" "${@}"
}
apt_install_release() {
apt_install_target "${DEBIAN_CODENAME}" "${@}"
}
apt_install_target() {
local target="${1}"
shift
local package
for package in "${@}"; do
log_info
log_info "${package}${target}"
apt-get \
install \
--assume-yes \
--target-release "${target}" \
"${package}"
apt_clean
done
}
apt_update() {
apt-get \
update
}
apt_upgrade() {
apt-get \
upgrade \
--assume-yes
apt_clean
}