Add pacman cache cleanup utilities

This commit is contained in:
ItsDrike 2021-04-01 19:27:56 +02:00
parent adc2266932
commit 1c8c3379b6
No known key found for this signature in database
GPG key ID: 252D306F545351FC
4 changed files with 29 additions and 3 deletions

3
.gitignore vendored
View file

@ -22,9 +22,6 @@ env/
# Ignore ds store files
.DS_STORE
# Backup files
*.bak
# Personal TODO files
TODO

View file

@ -8,6 +8,7 @@ pacman:
- net-tools
# CLI
- pacman-contrib # Contains many useful scripts for pacman, such as paccache
- exa # Modern ls replacement
- ncdu # Show folder sizes in a neat CLI graphical way
- cron # Scheduling program

View file

@ -0,0 +1,13 @@
# Clean pacman cache of old and uninstalled packages every month
# This needs to be started by systemctl stat paccache.timer
# Usage requires pacman-contrib package to be installed
[Unit]
Description=Clean-up old pacman pkg
[Timer]
OnCalendar=monthly
Persistent=true
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,15 @@
# Pacman hook to automatically run paccache -r with pacman
# This hook is disabled by default, it can be enabled by
# renaming this file from paccache.hook.bak to paccache.hook
[Trigger]
Operation = Upgrade
Operation = Install
Operation = Remove
Type = Package
Target = *
[Action]
Description = Cleaning pacman cache with paccache ...
When = PostTransaction
Exec = /usr/bin/paccache -r