You are not logged in.

#1 2011-08-06 10:07:38

tuxitop
Member
From: Mashhad, Iran
Registered: 2011-04-04
Posts: 24

How to remove old packages no matter installed or not from the cache?

I'm aware of the "pacman -Sc" command but I need a way to delete a package if there is a newer version of it in the cache folder (or maybe in repositories).

Is there any way to do that?

Offline

#2 2011-08-06 10:10:22

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: How to remove old packages no matter installed or not from the cache?

I searched a bit for you:
https://bbs.archlinux.org/viewtopic.php?pid=841774

Edit: Hmm, I you may do this using "CleanMethod = KeepCurrent" in pacman.conf.

Last edited by lolilolicon (2011-08-06 10:16:55)


This silver ladybug at line 28...

Offline

#3 2011-08-06 10:13:35

Shark
Member
From: /dev/zero
Registered: 2011-02-28
Posts: 686

Re: How to remove old packages no matter installed or not from the cache?

From pacman manpage:

-c, --clean

    Remove packages that are no longer installed from the cache as well as currently unused sync databases to free up disk space. When pacman downloads packages, it saves them in a cache directory. In addition, databases are saved for every sync DB you download from, and are not deleted even if they are removed from the configuration file pacman.conf(5). Use one --clean switch to only remove packages that are no longer installed; use two to remove all packages from the cache. In both cases, you will have a yes or no option to remove packages and/or unused downloaded databases.
 

So, to remove all packages from cache you have to write option c twice:

pacman -Scc

Last edited by Shark (2011-08-06 10:21:57)


If you have built castles in the air, your work need not be lost; that is where they should be. Now put foundations under them.
Henry David Thoreau

Registered Linux User: #559057

Offline

#4 2011-09-13 10:13:22

tuxitop
Member
From: Mashhad, Iran
Registered: 2011-04-04
Posts: 24

Re: How to remove old packages no matter installed or not from the cache?

lolilolicon wrote:

you may do this using "CleanMethod = KeepCurrent" in pacman.conf.

thanks. I think this is exactly what I need. although I have already written a script for this! how dumb am I?! I should have checked here sooner.

Offline

#5 2011-09-13 17:14:06

sitquietly
Member
From: On the Wolf River
Registered: 2010-07-12
Posts: 220

Re: How to remove old packages no matter installed or not from the cache?

tuxitop wrote:
lolilolicon wrote:

you may do this using "CleanMethod = KeepCurrent" in pacman.conf.

thanks. I think this is exactly what I need. although I have already written a script for this...

I would like to see your script. Could you post it here?

Offline

#6 2011-09-13 17:18:56

tuxitop
Member
From: Mashhad, Iran
Registered: 2011-04-04
Posts: 24

Re: How to remove old packages no matter installed or not from the cache?

sitquietly wrote:

I would like to see your script. Could you post it here?

I have already posted it here and I've got a couple of nice feedbacks on that smile
https://bbs.archlinux.org/viewtopic.php … 26#p990126

Offline

Board footer

Powered by FluxBB