[opensuse] Anyway to preserve currently installed packages with 'zypper clean (cc)'
All, Is there any way to use a zypper or rpm command to clean the current package and metadata cache of all packages EXCEPT the currently installed working set of packages? From the man page, it looks like you either clean all, packages or metadata or you are out of luck. For years I've used a script to move older packages out of the package cache (off the root partition) and over to a directory under /home while leaving the currently installed packages in /var/cache/zypp/packages. For example under /home/admin/dups I have: 22:08 wizard:/home/admin/dups> tree -d . ├── adobe ├── cinelerra ├── gnomeapps │ ├── noarch │ └── x86_64 ├── kde │ ├── noarch │ └── x86_64 ├── mozilla │ └── x86_64 ├── nvidia │ └── x86_64 ├── packman │ ├── Essentials │ │ └── x86_64 │ ├── Extra │ │ └── x86_64 │ └── Multimedia │ └── x86_64 ├── publish │ ├── noarch │ └── x86_64 ├── update │ ├── noarch │ └── x86_64 ├── videolan │ ├── noarch │ └── x86_64 ├── x11utl │ └── x86_64 └── x11wm ├── noarch └── x86_64 Which after a few days/weeks of insuring there are no surprises with the new packages, I can just delete. The remaining packages in /var/cache/zypp/packages can then be rsynced to a local update repo, etc.. (not nearly as important with broadband as it was on dialup...) The point being, I always like to keep a "working set" of rpms. Is there a way that zypper or rpm can do the purge all but the current rpms from the cache? If not, possible feature? Arch does this with 'pacman -Sc', which is quite convenient. (providing 'pacman -Scc' to remove all) It seems like zypper should be able to do this too. Or, am I just stuck with the scripts? -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 16/12/2018 05.22, David C. Rankin wrote:
All,
Is there any way to use a zypper or rpm command to clean the current package and metadata cache of all packages EXCEPT the currently installed working set of packages? From the man page, it looks like you either clean all, packages or metadata or you are out of luck.
You mean to purge the /var/cache/zypp/packages cache, when using in the repo definition "keep downloaded packages"? No. -- Cheers / Saludos, Carlos E. R. (from 42.3 x86_64 "Malachite" at Telcontar)
On 12/17/2018 08:59 AM, Carlos E.R. wrote:
You mean to purge the /var/cache/zypp/packages cache, when using in the repo definition "keep downloaded packages"?
No.
Yes, Carlos, that was what I meant. Bummer. I'll keep using the script (one of these days I may also update it, since it is the same one I have used since 2008 -- ugly....) It would be nice if zypper would grep the /etc/zypp/repos.d dir for "keeppackages=1" and preserve the currently installed package for those repos. Seems like a fairly straight forward solution. Here's to hoping... -- David C. Rankin, J.D.,P.E.
On 18/12/2018 07.33, David C. Rankin wrote:
On 12/17/2018 08:59 AM, Carlos E.R. wrote:
You mean to purge the /var/cache/zypp/packages cache, when using in the repo definition "keep downloaded packages"?
No.
Yes, Carlos, that was what I meant. Bummer. I'll keep using the script (one of these days I may also update it, since it is the same one I have used since 2008 -- ugly....)
It would be nice if zypper would grep the /etc/zypp/repos.d dir for "keeppackages=1" and preserve the currently installed package for those repos. Seems like a fairly straight forward solution. Here's to hoping...
The real solution would be to have a zypper proxy daemon, as other distributions have, but they don't want to create it. There are zypper operations that can delete that cache. I reported that in bugzilla once, and was told that the cache usage was not supported. -- Cheers / Saludos, Carlos E. R. (from 42.3 x86_64 "Malachite" at Telcontar)
On Sunday 16 December 2018 05:22:14 David C. Rankin wrote:
The point being, I always like to keep a "working set" of rpms. Is there a way that zypper or rpm can do the purge all but the current rpms from the cache? If not, possible feature?
Should not be too hard to offer smarter policies (age based and/or removing uninstalled packages only). https://github.com/openSUSE/zypper/issues/229 -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres SUSE LINUX GmbH, Development, ma@suse.com Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 74 053-0 +------------------------------------------------------------------+ SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) +------------------------------------------------------------------+ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (4)
-
Carlos E. R.
-
Carlos E.R.
-
David C. Rankin
-
Michael Andres