7e4273f44075ff4ec81778a16bf578e05cc8ca4c

Author
Björn Daase <bjoern.daase@student.hpi.de>
Committer
Marc Cornellà <hello@mcornella.com>
Date

Message

feat(debian): add `alu` alias for list and upgrade packages (#7928)

Closes #7928

Diff

 1diff --git a/plugins/debian/README.md b/plugins/debian/README.md
 2index ac2eec84d5c85228ac1f1aae407d573906ca2d8a..2ce206cfbaca289b102b7d54ad8f73a9b6030407 100644
 3--- a/plugins/debian/README.md
 4+++ b/plugins/debian/README.md
 5@@ -33,21 +33,22 @@ Set `$apt_pref` and `$apt_upgr` to whatever command you want (before sourcing Oh
 6 | Alias    | Command                                                                                | Description                                                                                 |
 7 | -------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
 8 | `aac`    | `sudo $apt_pref autoclean`                                                             | Clears out the local repository of retrieved package files                                  |
 9+| `aar`    | `sudo $apt_pref autoremove`                                                            | Removes packages installed automatically that are no longer needed                          |
10 | `abd`    | `sudo $apt_pref build-dep`                                                             | Installs all dependencies for building packages                                             |
11 | `ac`     | `sudo $apt_pref clean`                                                                 | Clears out the local repository of retrieved package files except lock files                |
12 | `ad`     | `sudo $apt_pref update`                                                                | Updates the package lists for upgrades for packages                                         |
13 | `adg`    | `sudo $apt_pref update && sudo $apt_pref $apt_upgr`                                    | Update and upgrade packages                                                                 |
14+| `ads`    | `sudo apt-get dselect-upgrade`                                                         | Installs packages from list and removes all not in the list                                 |
15 | `adu`    | `sudo $apt_pref update && sudo $apt_pref dist-upgrade`                                 | Smart upgrade that handles dependencies                                                     |
16 | `afu`    | `sudo apt-file update`                                                                 | Update the files in packages                                                                |
17-| `au`     | `sudo $apt_pref $apt_upgr`                                                             | Install package upgrades                                                                    |
18 | `ai`     | `sudo $apt_pref install`                                                               | Command-line tool to install package                                                        |
19 | `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 |
20+| `alu`    | `sudo apt update && apt list -u && sudo apt upgrade`                                   | Update, list and upgrade packages                                                           |
21 | `ap`     | `sudo $apt_pref purge`                                                                 | Removes packages along with configuration files                                             |
22 | `ar`     | `sudo $apt_pref remove`                                                                | Removes packages, keeps the configuration files                                             |
23-| `aar`    | `sudo $apt_pref autoremove`                                                            | Removes packages installed automatically that are no longer needed                          |
24-| `ads`    | `sudo apt-get dselect-upgrade`                                                         | Installs packages from list and removes all not in the list                                 |
25-| `dia`    | `sudo dpkg -i ./*.deb`                                                                 | Install all .deb files in the current directory                                             |
26+| `au`     | `sudo $apt_pref $apt_upgr`                                                             | Install package upgrades                                                                    |
27 | `di`     | `sudo dpkg -i`                                                                         | Install all .deb files in the current directory                                             |
28+| `dia`    | `sudo dpkg -i ./*.deb`                                                                 | Install all .deb files in the current directory                                             |
29 | `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                                  |
30 
31 ## Aliases - Commands using `su`
32@@ -77,8 +78,8 @@ Set `$apt_pref` and `$apt_upgr` to whatever command you want (before sourcing Oh
33 | ------------------- | --------------------------------------------------------------- |
34 | `apt-copy`          | Create a simple script that can be used to 'duplicate' a system |
35 | `apt-history`       | Displays apt history for a command                              |
36-| `kerndeb`           | Builds kernel packages                                          |
37 | `apt-list-packages` | List packages by size                                           |
38+| `kerndeb`           | Builds kernel packages                                          |
39 
40 ## Authors
41 
42diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh
43index 5fa1270b8f57ca2e6d22bae3ea69c90a4f18c02c..e4db8fe339540115a93a48a866b1ba71f0c49375 100644
44--- a/plugins/debian/debian.plugin.zsh
45+++ b/plugins/debian/debian.plugin.zsh
46@@ -61,6 +61,9 @@ if [[ $use_sudo -eq 1 ]]; then
47     # apt-get only
48     alias ads="sudo apt-get dselect-upgrade"
49 
50+    # apt only
51+    alias alu="sudo apt update && apt list -u && sudo apt upgrade"
52+
53     # Install all .deb files in the current directory.
54     # Warning: you will need to put the glob in single quotes if you use:
55     # glob_subst