Back to Ohmyzsh

debian

plugins/debian/README.md

latest7.4 KB
Original Source

debian

This plugin provides Debian-related aliases and functions for zsh.

To use it add debian to the plugins array in your zshrc file.

zsh
plugins=(... debian)

Settings

  • $apt_pref: use aptitude or apt if installed, fallback is apt-get.
  • $apt_upgr: use upgrade or safe-upgrade (for aptitude).

Set both $apt_pref and $apt_upgr to whatever command you want (before sourcing Oh My Zsh) to override this behavior, e.g.:

sh
apt_pref='apt'
apt_upgr='full-upgrade'

Common Aliases

AliasCommandDescription
ageapt-getCommand line tool for handling packages
apiaptitudeSame functionality as apt-get, provides extra options
acsapt-cache searchCommand line tool for searching apt software package cache
apsaptitude searchSearches installed packages using aptitude
asaptitude -F '* %p -> %d \n(%v/%V)' --no-gui --disable-columns searchPrint searched packages using a custom format
afsapt-file search --regexpSearch file in packages
asrcapt-get sourceFetch source packages through apt-get
appapt-cache policyDisplays priority of package sources

Superuser Operations Aliases

AliasCommandDescription
aacsudo $apt_pref autocleanClears out the local repository of retrieved package files
aarsudo $apt_pref autoremoveRemoves packages installed automatically that are no longer needed
abdsudo $apt_pref build-depInstalls all dependencies for building packages
acsudo $apt_pref cleanClears out the local repository of retrieved package files except lock files
adsudo $apt_pref updateUpdates the package lists for upgrades for packages
adgsudo $apt_pref update && sudo $apt_pref $apt_upgrUpdate and upgrade packages
adssudo apt-get dselect-upgradeInstalls packages from list and removes all not in the list
adusudo $apt_pref update && sudo $apt_pref dist-upgradeSmart upgrade that handles dependencies
afusudo apt-file updateUpdate the files in packages
aisudo $apt_pref installCommand-line tool to install package
ailsed -e 's/ */ /g' -e 's/ *//' | cut -s -d ' ' -f 1 | xargs sudo $apt_pref installInstall all packages given on the command line while using only the first word of each line
alusudo apt update && apt list -u && sudo apt upgradeUpdate, list and upgrade packages
apsudo $apt_pref purgeRemoves packages along with configuration files
ausudo $apt_pref $apt_upgrInstall package upgrades
disudo dpkg -iInstall all .deb files in the current directory
diasudo dpkg -i ./*.debInstall all .deb files in the current directory
kcleansudo aptitude remove -P ?and(~i~nlinux-(ima|hea) ?not(~n$(uname -r)))Remove ALL kernel images and headers EXCEPT the one in use

Aliases - Commands using su

AliasCommand
aacsu -ls "$apt_pref autoclean" root
aarsu -ls "$apt_pref autoremove" root
acsu -ls "$apt_pref clean" root
adsu -lc "$apt_pref update" root
adgsu -lc "$apt_pref update && aptitude $apt_upgr" root
adusu -lc "$apt_pref update && aptitude dist-upgrade" root
afusu -lc "apt-file update"
ausu -lc "$apt_pref $apt_upgr" root
diasu -lc "dpkg -i ./*.deb" root

Miscellaneous Aliases

AliasCommandDescription
allpkgsaptitude search -F "%p" --disable-columns ~iDisplay all installed packages
mydebtime dpkg-buildpackage -rfakeroot -us -ucCreate a basic .deb package

Functions

FunctionDescription
apt-copyCreate a simple script that can be used to 'duplicate' a system
apt-historyDisplays apt history for a command
apt-list-packagesList packages by size
kerndebBuilds kernel packages

Authors