145 lines
4.3 KiB
Markdown
145 lines
4.3 KiB
Markdown
# AurManager
|
|
|
|
A small set of shell scripts to manage AUR packages on Arch Linux **without** `yay`, `paru`, or any other AUR helper.
|
|
|
|
This project follows the classic AUR workflow: clone the package repository, review the `PKGBUILD`, build with `makepkg`, and install with `pacman -U`.
|
|
|
|
## Included scripts
|
|
|
|
- `aurinstall` — clone or update an AUR package repository, optionally review `PKGBUILD`, build the package, and install it with `pacman -U`.
|
|
- `aurupdate` — iterate through local AUR package repositories, pull updates, rebuild selected packages, and reinstall them locally.
|
|
- `aurremove` — remove installed AUR packages with `pacman -Rns` and optionally delete the local repository directory.
|
|
- `_aurtools` — Zsh completion file for the scripts, including optional online package-name completion for `aurinstall` via the AUR RPC interface.
|
|
|
|
## Why use this
|
|
|
|
This setup is intended for users who want full visibility into what gets built and installed from the AUR. Instead of relying on a full AUR helper, it keeps each package as a normal Git repository under `~/Aur`, making updates and audits easier to understand and review.
|
|
|
|
## Requirements
|
|
|
|
Install the usual Arch build tools first:
|
|
|
|
```bash
|
|
sudo pacman -S --needed base-devel git
|
|
```
|
|
|
|
Some optional features require additional tools:
|
|
|
|
```bash
|
|
sudo pacman -S curl jq zsh
|
|
```
|
|
|
|
- `curl` and `jq` are used by the optional online completion for `aurinstall` through the AUR RPC API.
|
|
- `zsh` is needed only for the provided completion script.
|
|
- An editor such as `nvim` is useful if `aurinstall` is run with review options like `-e`, `-E`, or `-d`.
|
|
|
|
## Installation
|
|
|
|
Copy the scripts somewhere in your `PATH`, for example `~/.local/bin`:
|
|
|
|
```bash
|
|
mkdir ~/Aur
|
|
install -Dm755 aurinstall ~/.local/bin/aurinstall
|
|
install -Dm755 aurupdate ~/.local/bin/aurupdate
|
|
install -Dm755 aurremove ~/.local/bin/aurremove
|
|
```
|
|
|
|
Install the Zsh completion file:
|
|
|
|
```bash
|
|
mkdir -p ~/.zsh/completions
|
|
install -Dm644 completions/_aurtools ~/.zsh/completions/_aurtools
|
|
```
|
|
|
|
Then ensure the completion directory is in `fpath` and initialize completion in `~/.zshrc`:
|
|
|
|
```zsh
|
|
fpath=("$HOME/.zsh/completions" $fpath)
|
|
autoload -Uz compinit
|
|
compinit
|
|
```
|
|
|
|
## Repository layout
|
|
|
|
The scripts assume that AUR repositories are stored under `~/Aur` by default:
|
|
|
|
```text
|
|
~/Aur/
|
|
├── package-one/
|
|
├── package-two/
|
|
└── package-three/
|
|
```
|
|
|
|
Each package is kept as its own Git repository cloned from `https://aur.archlinux.org/<pkgname>.git`, which matches the documented AUR workflow.
|
|
|
|
## Usage
|
|
|
|
### Install a package
|
|
|
|
```bash
|
|
aurinstall proton-pass-bin
|
|
```
|
|
|
|
This clones the package if needed, builds it with `makepkg`, and installs the resulting package file with `pacman -U`.
|
|
|
|
### Prompt before editing build files
|
|
|
|
```bash
|
|
aurinstall -e swayfx
|
|
```
|
|
|
|
### Always open `PKGBUILD` before building
|
|
|
|
```bash
|
|
aurinstall -E swayfx
|
|
```
|
|
|
|
Reviewing `PKGBUILD` before building is an important AUR safety habit because `makepkg` executes build instructions defined there.
|
|
|
|
### Download and audit only
|
|
|
|
```bash
|
|
aurinstall -d swayfx
|
|
```
|
|
|
|
This mode updates or clones the repository and lets the user inspect package files without building or installing anything.
|
|
|
|
### Update local AUR repositories
|
|
|
|
```bash
|
|
aurupdate
|
|
```
|
|
|
|
This walks through the repositories stored in `~/Aur`, pulls upstream changes, and rebuilds selected packages.
|
|
|
|
### Remove a package
|
|
|
|
```bash
|
|
aurremove calcure
|
|
```
|
|
|
|
This removes the installed package with `pacman -Rns`, which removes the package, unneeded dependencies, and package-managed config files.
|
|
|
|
## Zsh completion
|
|
|
|
The included completion script supports:
|
|
|
|
- local completion from existing repositories in `~/Aur` for `aurinstall`
|
|
- optional remote name completion for `aurinstall` through the AUR RPC interface
|
|
- completion of installed foreign packages for `aurremove` via `pacman -Qm`
|
|
|
|
If completion behaves strangely after changes, rebuild the completion cache:
|
|
|
|
```zsh
|
|
rm -f ~/.cache/zsh/zcompdump*
|
|
autoload -Uz compinit
|
|
compinit
|
|
```
|
|
|
|
## Security note
|
|
|
|
AUR packages are user-contributed build scripts, not official binary packages. The safest workflow is to inspect `PKGBUILD`, sources, checksums, and build steps before installation.
|
|
|
|
## License
|
|
|
|
A permissive license such as MIT or ISC fits this kind of shell-script project well. GitHub recommends adding an explicit license if the repository is meant to be reused by others.
|