-
Notifications
You must be signed in to change notification settings - Fork 31
Manage APT packages
David-Apps edited this page Feb 13, 2023
·
1 revision
APT is a packaging tool usually available on Debian-based systems. You can use these functions to manage APT packages.
# Search the apt cache.
# usage: <aptsearch <keywords>
function+aptsearch {
db0
H-
ebvar-
bw
enew
f apt-cache search ~0
r !apt-cache search ~0
bw
# Delete the next line if you do not want this feedback.
=
1
if(?) {
}
}
# Show apt package information.
# usage: <aptshow [<package name>]
function+aptshow {
db0
H-
sw+
ebvar+
!true
ebvar-
bw
enew
r !apt-cache show $(if [ -n "~0" ]; then echo "~0"; else echo ${EB_DOT%% *}; fi)
if(*) {
f apt-cache show ~0
bw
/Description/
}
}
# Install apt package.
# usage: <aptinstall [<package name>]
function+aptinstall {
db1
H-
ebvar+
!sudo apt-get install $(if [ -n "~0" ]; then echo "~0"; else echo ${EB_DOT%% *}; fi) -q
}
# Update apt packages.
# usage: <aptupdate [<package name>]
function+aptupdate {
db1
H-
ebvar-
!sudo apt-get update -qq && sudo apt-get upgrade -qqq && sudo apt autoremove -qqq
}