diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2022-01-01 02:26:11 -0600 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2022-01-01 02:26:11 -0600 |
commit | 49edbf438ed690c76e6b2af80368c59404cf0167 (patch) | |
tree | 129b3adb2f5f39a1329a426a3b7d51ed2c2290c1 /plugins/debian | |
parent | 1bc186dabe12b3d01b2257e82f3a104c48b8b3c7 (diff) | |
parent | 78c91ccbf99c77bd4d9cdb74279a40776721f66d (diff) | |
download | zsh-49edbf438ed690c76e6b2af80368c59404cf0167.tar.gz zsh-49edbf438ed690c76e6b2af80368c59404cf0167.tar.bz2 zsh-49edbf438ed690c76e6b2af80368c59404cf0167.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'plugins/debian')
-rw-r--r-- | plugins/debian/README.md | 11 | ||||
-rw-r--r-- | plugins/debian/debian.plugin.zsh | 12 |
2 files changed, 18 insertions, 5 deletions
diff --git a/plugins/debian/README.md b/plugins/debian/README.md index 922d68cb3..2ce206cfb 100644 --- a/plugins/debian/README.md +++ b/plugins/debian/README.md @@ -33,20 +33,22 @@ Set `$apt_pref` and `$apt_upgr` to whatever command you want (before sourcing Oh | Alias | Command | Description | | -------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | | `aac` | `sudo $apt_pref autoclean` | Clears out the local repository of retrieved package files | +| `aar` | `sudo $apt_pref autoremove` | Removes packages installed automatically that are no longer needed | | `abd` | `sudo $apt_pref build-dep` | Installs all dependencies for building packages | | `ac` | `sudo $apt_pref clean` | Clears out the local repository of retrieved package files except lock files | | `ad` | `sudo $apt_pref update` | Updates the package lists for upgrades for packages | | `adg` | `sudo $apt_pref update && sudo $apt_pref $apt_upgr` | Update and upgrade packages | +| `ads` | `sudo apt-get dselect-upgrade` | Installs packages from list and removes all not in the list | | `adu` | `sudo $apt_pref update && sudo $apt_pref dist-upgrade` | Smart upgrade that handles dependencies | | `afu` | `sudo apt-file update` | Update the files in packages | -| `au` | `sudo $apt_pref $apt_upgr` | Install package upgrades | | `ai` | `sudo $apt_pref install` | Command-line tool to install package | | `ail` | `sed -e 's/ */ /g' -e 's/ *//' \| cut -s -d ' ' -f 1 \| xargs sudo $apt_pref install` | Install all packages given on the command line while using only the first word of each line | +| `alu` | `sudo apt update && apt list -u && sudo apt upgrade` | Update, list and upgrade packages | | `ap` | `sudo $apt_pref purge` | Removes packages along with configuration files | | `ar` | `sudo $apt_pref remove` | Removes packages, keeps the configuration files | -| `ads` | `sudo apt-get dselect-upgrade` | Installs packages from list and removes all not in the list | -| `dia` | `sudo dpkg -i ./*.deb` | Install all .deb files in the current directory | +| `au` | `sudo $apt_pref $apt_upgr` | Install package upgrades | | `di` | `sudo dpkg -i` | Install all .deb files in the current directory | +| `dia` | `sudo dpkg -i ./*.deb` | Install all .deb files in the current directory | | `kclean` | `sudo 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` @@ -54,6 +56,7 @@ Set `$apt_pref` and `$apt_upgr` to whatever command you want (before sourcing Oh | Alias | Command | | ----- | --------------------------------------------------------- | | `aac` | `su -ls "$apt_pref autoclean" root` | +| `aar` | `su -ls "$apt_pref autoremove" root` | | `ac` | `su -ls "$apt_pref clean" root` | | `ad` | `su -lc "$apt_pref update" root` | | `adg` | `su -lc "$apt_pref update && aptitude $apt_upgr" root` | @@ -75,8 +78,8 @@ Set `$apt_pref` and `$apt_upgr` to whatever command you want (before sourcing Oh | ------------------- | --------------------------------------------------------------- | | `apt-copy` | Create a simple script that can be used to 'duplicate' a system | | `apt-history` | Displays apt history for a command | -| `kerndeb` | Builds kernel packages | | `apt-list-packages` | List packages by size | +| `kerndeb` | Builds kernel packages | ## Authors diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh index bde97cd30..e4db8fe33 100644 --- a/plugins/debian/debian.plugin.zsh +++ b/plugins/debian/debian.plugin.zsh @@ -52,13 +52,18 @@ if [[ $use_sudo -eq 1 ]]; then alias ai="sudo $apt_pref install" # Install all packages given on the command line while using only the first word of each line: # acs ... | ail + alias ail="sed -e 's/ */ /g' -e 's/ *//' | cut -s -d ' ' -f 1 | xargs sudo $apt_pref install" alias ap="sudo $apt_pref purge" alias ar="sudo $apt_pref remove" + alias aar="sudo $apt_pref autoremove" # apt-get only alias ads="sudo apt-get dselect-upgrade" + # apt only + alias alu="sudo apt update && apt list -u && sudo apt upgrade" + # Install all .deb files in the current directory. # Warning: you will need to put the glob in single quotes if you use: # glob_subst @@ -98,7 +103,11 @@ else print "$cmd" eval "$cmd" } - + function aar() { + cmd="su -lc '$apt_pref -P autoremove $@' root" + print "$cmd" + eval "$cmd" + } # Install all .deb files in the current directory # Assumes glob_subst is off alias dia='su -lc "dpkg -i ./*.deb" root' @@ -139,6 +148,7 @@ apt_pref_compdef ai "install" apt_pref_compdef ail "install" apt_pref_compdef ap "purge" apt_pref_compdef ar "remove" +apt_pref_compdef aar "autoremove" apt_pref_compdef ads "dselect-upgrade" # Misc. ##################################################################### |