Pamac clean ALL caches in a one liner script

This one does not work, because its a one liner?

pamac  clean -k 0  -b --no-confirm

Its ok if i split this command in two lines:

#! /bin/sh
echo "pamac clean all caches"
# OHNE build Dateien
/usr/bin/pamac  clean  -v --no-confirm
# jetzt extra build-Dateien
/usr/bin/pamac  clean  -b -v --no-confirm

But why is not possible as a one liner?

Just curious.

I would not try to build a systemd service, run every day at 23 o’clock to clean all caches if i could tell pamac or pacman to avoid any use of cache!

-b : remove only aur cache
these 2 caches are very different
you can add 2 commands in an alias as “pacman clean -k 1 && pamac clean -b”

This service exists, and is enabled. You can override him

/usr/lib/systemd/system/pamac-cleancache.timer # run .service one run by month

cache aur or pacman ? not possible to not use cache (where download packages ?) we can only use /tmp/ if we have ram for that. Directory for pacman is in etc/pacman.conf

Do you lack so much space to consider these extremes?

I’m on stable branch and do a complete system-backup every night with backintime. So i never need that cache!

backup and clear “aur build cache” :astonished: this cache is useful for update ! if you clear him : you not use it and so no raison to backup him

For pacman cache… as written, we have a active timer for clear it, you can change it (OnCalendar key)

Tip: When pasting terminal output on Discourse forums, one can either…

  • Highlight it and use the Preformatted text </> toolbar button.

  • Add three backticks ` above and below the text (Markdown):


  • Use HTML:


I’ve done it for you this time. :wink:

Thank you i have to remember these


I’m nearly blind so i have huge fonts and small edit boxes where its really hard to mark text with mouse :frowning:

I adjusted pamac-cleancache.timer and *.service to be run every day!

I’ll see tomorrow if that works, thank you for that tipp!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.