parent
83ceba60d5
commit
3e5f0b3cf6
2 changed files with 0 additions and 0 deletions
72
sh/pm/apt.extra.sh
Normal file
72
sh/pm/apt.extra.sh
Normal file
|
@ -0,0 +1,72 @@
|
|||
RWX_DEBIAN_CODENAME="$(
|
||||
grep "VERSION_CODENAME" "/etc/os-release" |
|
||||
cut --delimiter "=" --fields "2"
|
||||
)"
|
||||
|
||||
rwx_apt_clean() {
|
||||
apt-get \
|
||||
clean
|
||||
}
|
||||
|
||||
rwx_apt_conf_write() {
|
||||
printf "\
|
||||
Acquire::AllowInsecureRepositories False;
|
||||
Acquire::AllowWeakRepositories False;
|
||||
Acquire::AllowDowngradeToInsecureRepositories False;
|
||||
Acquire::Check-Valid-Until True;
|
||||
APT::Install-Recommends False;
|
||||
APT::Install-Suggests False;
|
||||
APT::Get::Show-Versions True;
|
||||
Dir::Etc::SourceParts \"\";
|
||||
Dpkg::Progress True;
|
||||
" >"/etc/apt/apt.conf.d/apt.conf"
|
||||
}
|
||||
|
||||
rwx_apt_install_backports() {
|
||||
rwx_apt_install_target "${RWX_DEBIAN_CODENAME}-backports" "${@}"
|
||||
}
|
||||
|
||||
rwx_apt_install_release() {
|
||||
rwx_apt_install_target "${RWX_DEBIAN_CODENAME}" "${@}"
|
||||
}
|
||||
|
||||
rwx_apt_install_target() {
|
||||
local target="${1}"
|
||||
shift
|
||||
local package
|
||||
for package in "${@}"; do
|
||||
rwx_log "" \
|
||||
"${package} ← ${target}"
|
||||
apt-get \
|
||||
install \
|
||||
--assume-yes \
|
||||
--target-release "${target}" \
|
||||
"${package}"
|
||||
rwx_apt_clean
|
||||
done
|
||||
}
|
||||
|
||||
rwx_apt_sources_write() {
|
||||
printf "%s" "\
|
||||
deb https://deb.debian.org/debian \
|
||||
${RWX_DEBIAN_CODENAME} main non-free-firmware contrib non-free
|
||||
deb https://deb.debian.org/debian \
|
||||
${RWX_DEBIAN_CODENAME}-backports main non-free-firmware contrib non-free
|
||||
deb https://deb.debian.org/debian \
|
||||
${RWX_DEBIAN_CODENAME}-updates main non-free-firmware contrib non-free
|
||||
deb https://deb.debian.org/debian-security \
|
||||
${RWX_DEBIAN_CODENAME}-security main non-free-firmware contrib non-free
|
||||
" >"/etc/apt/sources.list"
|
||||
}
|
||||
|
||||
rwx_apt_update() {
|
||||
apt-get \
|
||||
update
|
||||
}
|
||||
|
||||
rwx_apt_upgrade() {
|
||||
apt-get \
|
||||
upgrade \
|
||||
--assume-yes
|
||||
rwx_apt_clean
|
||||
}
|
93
sh/pm/apt.sh
Normal file
93
sh/pm/apt.sh
Normal file
|
@ -0,0 +1,93 @@
|
|||
# functions handling apt
|
||||
|
||||
# show package information
|
||||
#= acl
|
||||
rwx_apt_cache_list() {
|
||||
apt-cache \
|
||||
show \
|
||||
"${@}"
|
||||
}
|
||||
|
||||
# package versions policy
|
||||
#= acp
|
||||
rwx_apt_cache_policy() {
|
||||
apt-cache \
|
||||
policy \
|
||||
"${@}"
|
||||
}
|
||||
|
||||
# search package
|
||||
#= acs
|
||||
rwx_apt_cache_search() {
|
||||
apt-cache \
|
||||
search \
|
||||
"${@}"
|
||||
}
|
||||
|
||||
#= agap
|
||||
rwx_apt_get_auto_purge() {
|
||||
apt-get \
|
||||
autopurge \
|
||||
"${@}"
|
||||
}
|
||||
|
||||
#= agar
|
||||
rwx_apt_get_auto_remove() {
|
||||
apt-get \
|
||||
autoremove \
|
||||
"${@}"
|
||||
}
|
||||
|
||||
# clean packages cache
|
||||
#= agc
|
||||
rwx_apt_get_clean() {
|
||||
apt-get \
|
||||
clean \
|
||||
"${@}"
|
||||
}
|
||||
|
||||
# upgrade allowing package installation or removal
|
||||
#= agfu
|
||||
rwx_apt_get_full_upgrade() {
|
||||
apt-get \
|
||||
full-upgrade \
|
||||
"${@}"
|
||||
}
|
||||
|
||||
# install packages
|
||||
#= agi
|
||||
rwx_apt_get_install() {
|
||||
apt-get \
|
||||
install \
|
||||
"${@}"
|
||||
}
|
||||
|
||||
#= agp
|
||||
rwx_apt_get_purge() {
|
||||
apt-get \
|
||||
purge \
|
||||
"${@}"
|
||||
}
|
||||
|
||||
#= agr
|
||||
rwx_apt_get_remove() {
|
||||
apt-get \
|
||||
remove \
|
||||
"${@}"
|
||||
}
|
||||
|
||||
# update packages catalog
|
||||
#= agud
|
||||
rwx_apt_get_up_date() {
|
||||
apt-get \
|
||||
update \
|
||||
"${@}"
|
||||
}
|
||||
|
||||
# upgrade forbidding package installation or removal
|
||||
#= agug
|
||||
rwx_apt_get_up_grade() {
|
||||
apt-get \
|
||||
upgrade \
|
||||
"${@}"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue