- Shell 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .forgejo/workflows | ||
| .github/workflows | ||
| systemd | ||
| .gitignore | ||
| dnfsweep | ||
| install.sh | ||
| LICENSE.md | ||
| README.md | ||
dnfsweep
dnf clean all doesn't really tell you anything, but it takes everything. dnfsweep shows you what each repo actually costs you on disk, then removes what you ask for.
it reads the dnf5 (/var/cache/libdnf5) and dnf4 (/var/cache/dnf) layouts and the per-user caches at $XDG_CACHE_HOME, and doesn't dare touch a path that isn't in one of these roots.
fawn@fawn:~/Git/dnfsweep$ dnfsweep
/var/cache/libdnf5
REPOSITORY PACKAGES METADATA TOTAL
code - 507.9K 507.9K
@commandline - - -
fedora - 63.7M 63.7M
fedora-cisco-openh264 - 12.8K 12.8K
google-chrome - 11.5K 11.5K
updates - 37.0M 37.0M
-------------------------------------------------------
6 repos - 101.2M 101.2M
/home/fawn/.cache/libdnf5
REPOSITORY PACKAGES METADATA TOTAL
code - 507.9K 507.9K
fedora - 63.7M 63.7M
fedora-cisco-openh264 - 12.8K 12.8K
google-chrome - 11.5K 11.5K
updates - 37.0M 37.0M
-------------------------------------------------------
5 repos - 101.2M 101.2M
nothing to reclaim
install
git clone https://github.com/s0uthview/dnfsweep
cd dnfsweep
sudo ./install.sh
this drops the script in /usr/local/bin and offers to install the systemd timer. you can also copy dnfsweep somewhere on your $PATH if you don't want it installed there
usage
the default mode is --packages, which just removes downloaded .rpm files. those are safe to lose since dnf will refetch anything it needs next transaction. --metadata clears repodata and solv caches and will cost you a slower transaction, and --all is both.
nothing is deleted without confirmation, unless passing --yes, and --dry-run will report but not make any changes.
--repo and --exclude take globs and can be repeated. --cache-dir replaces autodetection.
to view the full list of options, run dnfsweep --help