2018-11-28 05:57:07 +08:00
# debian
2019-06-11 21:02:04 +08:00
This plugin provides Debian-related aliases and functions for zsh.
2018-11-28 05:57:07 +08:00
To use it add `debian` to the plugins array in your zshrc file.
```zsh
plugins=(... debian)
```
2019-06-11 21:02:04 +08:00
## Settings
2021-06-12 22:10:06 +08:00
- `$apt_pref` : use aptitude or apt if installed, fallback is apt-get.
2019-06-11 21:02:04 +08:00
- `$apt_upgr` : use upgrade or safe-upgrade (for aptitude).
2023-10-12 17:46:49 +08:00
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'
```
2019-06-11 21:02:04 +08:00
2018-11-28 05:57:07 +08:00
## Common Aliases
2019-06-11 21:02:04 +08:00
| Alias | Command | Description |
| ------ | ---------------------------------------------------------------------- | ---------------------------------------------------------- |
| `age` | `apt-get` | Command line tool for handling packages |
| `api` | `aptitude` | Same functionality as `apt-get` , provides extra options |
2023-07-19 20:28:33 +08:00
| `acs` | `apt-cache search` | Command line tool for searching apt software package cache |
2019-06-11 21:02:04 +08:00
| `aps` | `aptitude search` | Searches installed packages using aptitude |
| `as` | `aptitude -F '* %p -> %d \n(%v/%V)' --no-gui --disable-columns search` | Print searched packages using a custom format |
| `afs` | `apt-file search --regexp` | Search file in packages |
| `asrc` | `apt-get source` | Fetch source packages through `apt-get` |
| `app` | `apt-cache policy` | Displays priority of package sources |
2018-11-28 05:57:07 +08:00
## Superuser Operations Aliases
2022-10-01 17:21:19 +08:00
| 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 |
| `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 |
| `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 |
2018-11-28 05:57:07 +08:00
## Aliases - Commands using `su`
2019-06-11 21:02:04 +08:00
| Alias | Command |
| ----- | --------------------------------------------------------- |
| `aac` | `su -ls "$apt_pref autoclean" root` |
2021-12-29 18:08:02 +08:00
| `aar` | `su -ls "$apt_pref autoremove" root` |
2019-06-11 21:02:04 +08:00
| `ac` | `su -ls "$apt_pref clean" root` |
| `ad` | `su -lc "$apt_pref update" root` |
| `adg` | `su -lc "$apt_pref update && aptitude $apt_upgr" root` |
| `adu` | `su -lc "$apt_pref update && aptitude dist-upgrade" root` |
| `afu` | `su -lc "apt-file update"` |
| `au` | `su -lc "$apt_pref $apt_upgr" root` |
| `dia` | `su -lc "dpkg -i ./*.deb" root` |
2018-11-28 05:57:07 +08:00
## Miscellaneous Aliases
2019-06-11 21:02:04 +08:00
| Alias | Command | Description |
| --------- | ---------------------------------------------- | ------------------------------ |
| `allpkgs` | `aptitude search -F "%p" --disable-columns ~i` | Display all installed packages |
| `mydeb` | `time dpkg-buildpackage -rfakeroot -us -uc` | Create a basic .deb package |
2018-11-28 05:57:07 +08:00
## Functions
2019-06-11 21:02:04 +08:00
| Function | Description |
| ------------------- | --------------------------------------------------------------- |
| `apt-copy` | Create a simple script that can be used to 'duplicate' a system |
| `apt-history` | Displays apt history for a command |
| `apt-list-packages` | List packages by size |
2019-06-15 02:50:16 +08:00
| `kerndeb` | Builds kernel packages |
2019-06-11 21:02:04 +08:00
## Authors
2018-11-28 05:57:07 +08:00
2019-06-11 21:02:04 +08:00
- [@AlexBio ](https://github.com/AlexBio )
- [@dbb ](https://github.com/dbb )
- [@Mappleconfusers ](https://github.com/Mappleconfusers )