You are not logged in.

#1 2023-04-20 10:19:56

scatherinch
Member
Registered: 2023-02-24
Posts: 168

[SOLVED] Question about cleaning the package cache

I've been reading up on pacman at the arch wiki on how to properly clean my cache and found out that this can usually be done with pacman -Scc. However, whenever I run the command, it tells me it cleans the directory ( /var/cache/pacman/pkg/ ), but I still see a ton of files in there. Am I not doing something correctly to purge these?

I also tried sudo paccache -rk1

How can I completely get rid of these leftover files?

Last edited by scatherinch (2023-04-20 11:49:59)

Offline

#2 2023-04-20 10:28:52

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,111

Re: [SOLVED] Question about cleaning the package cache

paccache -rk1 will leave something over by definition, -Scc shouldn't, which left over files are you referring to exactly? Output of ls -l /var/cache/pacman/pkg/ ?

Online

#3 2023-04-20 10:41:07

scatherinch
Member
Registered: 2023-02-24
Posts: 168

Re: [SOLVED] Question about cleaning the package cache

Here you go!:

-rw-r--r-- 1 root root 9055875 Apr  6 22:40 dolphin-emu-1:5.0.r18498.46b99671d9-2-x86_64.pkg.tar.zst
-rw-r--r-- 1 root root     566 Apr  6 10:04 dolphin-emu-1:5.0.r18498.46b99671d9-2-x86_64.pkg.tar.zst.sig
-rw-r--r-- 1 root root   36623 Apr 20 01:06 libwbclient-4.18.2-1-x86_64.pkg.tar.zst
-rw-r--r-- 1 root root     310 Apr 20 01:06 libwbclient-4.18.2-1-x86_64.pkg.tar.zst.sig
-rw-r--r-- 1 root root   49638 Apr 16 22:34 pacman-contrib-1.9.0-1-x86_64.pkg.tar.zst
-rw-r--r-- 1 root root     566 Apr 16 22:34 pacman-contrib-1.9.0-1-x86_64.pkg.tar.zst.sig
-rw-r--r-- 1 root root 7083232 Apr 20 01:07 smbclient-4.18.2-1-x86_64.pkg.tar.zst
-rw-r--r-- 1 root root     310 Apr 20 01:07 smbclient-4.18.2-1-x86_64.pkg.tar.zst.sig

Last edited by scatherinch (2023-04-20 10:43:49)

Offline

#4 2023-04-20 10:46:54

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,111

Re: [SOLVED] Question about cleaning the package cache

That's not "a ton of files", all of those are the current version of the respective packages, if this is after you ran paccache -rk1 but you installed them after pacman -Scc then this is the completely expected result. paccache -rk1 keeps 1 version of any given package.

Online

#5 2023-04-20 10:58:13

scatherinch
Member
Registered: 2023-02-24
Posts: 168

Re: [SOLVED] Question about cleaning the package cache

Oh, I deleted the original folder after I realized there was quite a bit of bloat in there after I did a new installation. 

I do understand what you're saying and I read that in the wiki, but I suppose what I'm trying to ask is if there there's a way to remove the contents of this folder from the cli without having to delete the folder again. I simply like to keep my system tidy and organized to keep up with my regular cleaning rituals when I power my system down.

Last edited by scatherinch (2023-04-20 11:13:23)

Offline

#6 2023-04-20 11:34:43

kermit63
Member
Registered: 2018-07-04
Posts: 370

Re: [SOLVED] Question about cleaning the package cache

paccache -rk0 will remove everything and leave you with a blank /var/cache/pacman/pkg folder.


Never argue with an idiot, they will drag you down to their level and then beat you with experience.
It is better to light a candle than curse the darkness.
A journey of a thousand miles begins with a single step.

Offline

#7 2023-04-20 11:48:56

scatherinch
Member
Registered: 2023-02-24
Posts: 168

Re: [SOLVED] Question about cleaning the package cache

Ah, thank you, @kermit63! That certainly did the trick and now I have a fresh cache! For some reason I thought it would be more difficult than that.

Offline

#8 2023-04-20 12:00:33

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: [SOLVED] Question about cleaning the package cache

You don't need a seperate tool for that goal - just `rm /var/cache/pacman/pkg/*`


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#9 2023-04-21 02:41:40

bestfriend
Member
From: Seattle
Registered: 2020-08-04
Posts: 24

Re: [SOLVED] Question about cleaning the package cache

You can also set up a paccache systemd-timer or pacman hook to automate cleaning the cache.

systemctl enable --now paccache.timer

will setup paccache -rk3 to run every three days. You can locate the paccache.service file to adjust this to your needs.

Offline

Board footer

Powered by FluxBB