sh/shell/debian.sh

50 lines
735 B
Bash
Raw Normal View History

2024-11-12 05:03:36 +00:00
DEBIAN_CODENAME="$(
grep "VERSION_CODENAME" "/etc/os-release" |
cut --delimiter "=" --fields "2"
)"
2024-11-15 18:20:55 +00:00
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
}
2024-11-12 05:03:36 +00:00
debian_disable_frontend() {
2024-11-12 08:31:24 +00:00
export DEBIAN_FRONTEND="noninteractive"
2023-05-14 09:48:35 +00:00
}