https://github.com/yhndnzj/systemd-cleanup-pacman-hook
Stop and disable systemd units before removing packages
https://github.com/yhndnzj/systemd-cleanup-pacman-hook
pacman-hook systemd systemd-unit
Last synced: 3 months ago
JSON representation
Stop and disable systemd units before removing packages
- Host: GitHub
- URL: https://github.com/yhndnzj/systemd-cleanup-pacman-hook
- Owner: YHNdnzj
- License: mit
- Created: 2020-03-16T02:41:29.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-02-24T07:03:07.000Z (4 months ago)
- Last Synced: 2025-03-18T10:12:29.396Z (3 months ago)
- Topics: pacman-hook, systemd, systemd-unit
- Language: Shell
- Homepage: https://aur.archlinux.org/packages/systemd-cleanup-pacman-hook/
- Size: 49.8 KB
- Stars: 13
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# systemd-cleanup-pacman-hook
Stop and disable systemd units before removing packages
## Installation
```console
$ aur_helper -S systemd-cleanup-pacman-hook
```## Usage
Just remove packages as usual using `pacman`, and it will be taken care of automatically for you.
### Revert changes to units
The provided hook doesn't remove the override files (e.g. drop-in files) for the unit.
To also remove those automatically, modify the hook to use `--revert` option:
```console
# install -Dm644 /usr/share/libalpm/hooks/systemd-cleanup.hook /etc/pacman.d/hooks/systemd-cleanup.hook
# sed -i '/^Exec =/s/$/ --revert/' /etc/pacman.d/hooks/systemd-cleanup.hook
```### Check for broken symlinks
There might be existing broken symlinks to deleted systemd units in your system (before installing this hook).
You can use the command below to check for them:
```console
# find /etc/systemd/{system,user} -xtype l
```