You are not logged in.
Hey guys. I have a quick question of clarification about the pacman documentation.
The pacman manual and Wiki page explain that pacman -Sc "cleans the package cache of packages that are not currently installed" and that pacman -Scc "cleans the entire package cache". The Wiki goes on to explain that only -Scc will make it impossible to downgrade packages.
When I read this, I understood it to mean that pacman -Scc removes the entire cache of all packages but that that pacman -Sc only removes the entire cache of packages that I don't use anymore. For example, I thought that pacman -R firefox; pacman -Sc would remove Firefox and it's entire cache, but leave the package cache of Rhythmbox intact. Based on a quick test, it seems that pacman -Sc actually removes old package cache entries of all packages (i.e., all pkg.tar.gz files other than the ones currently being used).
First, am I understanding this situation correctly? If I am, does anyone think some rewording wording would be useful? The phrase "packages that are not currently installed" seems a bit misleading.
Thanks!
Offline
"cleans the package cache of packages that are not currently installed" -> keeps only the current versions of the installed packages
Offline
The phrase "packages that are not currently installed" seems a bit misleading.
How is it misleading? Would it be easier to understand if you removed the word currently, so it becomes "packages that are not installed"?
Offline
jalu wrote:The phrase "packages that are not currently installed" seems a bit misleading.
How is it misleading? Would it be easier to understand if you removed the word currently, so it becomes "packages that are not installed"?
It all comes down to deciding whether the previous versions of package xyz are in fact package xyz or not. From pacman's point of view, they are different packages so 'pacman -Sc' will remove them.
Offline
Thanks for the insight, karol and anonymous_user.
My original confusion is related to what karol describes. When reading the documentation, I unknowingly had a different definition of "package" than the one pacman uses. My understanding was that rhythmbox, for example, was a package, but that old versions of rhythmbox (rhythmbox-0.12.8-1-x86_64.pkg.tar.xz, rhythmbox-0.12.7-1-x86_64.pkg.tar.xz, etc.) constituted the package cache. I never thought of the old versions of rhythmbox as "packages" themselves, even though I consciously knew that this was the case.
Thus, when I read "packages that are not installed", I thought "Oh, like Rhythmbox, Banshee, and mpd -- I don't have any of those installed any more, so old versions of those packages (a.k.a. cache entries) will be removed if any exist."
It might just be me. I'll admit that I didn't read the pacman manual top-to-bottom, but maybe some more explicit documentation of -Sc and -Scc wouldn't hurt.
Last edited by jalu (2010-08-11 17:12:27)
Offline
I'll admit when I first read the man page I saw a little ambiguity as well, though in my case I thought the actual behavior seemed to be the most likely interpretation. If you have an idea for a better way of phrasing you could edit the wiki, and/or open a feature request on the bug tracker with a suggestion for clarified language.
Here's a suggestion based of the man page
Use one --clean switch to only remove packages that are no longer installed;
Use one --clean switch to only keep currently installed versions of packages
Offline
Thanks for the insight, karol and anonymous_user.
My original confusion is related to what karol describes. When reading the documentation, I unknowingly had a different definition of "package" than the one pacman uses. My understanding was that rhythmbox, for example, was a package, but that old versions of rhythmbox (rhythmbox-0.12.8-1-x86_64.pkg.tar.xz, rhythmbox-0.12.7-1-x86_64.pkg.tar.xz, etc.) constituted the package cache. I never thought of the old versions of rhythmbox as "packages" themselves, even though I consciously knew that this was the case.
Thus, when I read "packages that are not installed", I thought "Oh, like Rhythmbox, Banshee, and mpd -- I don't have any of those installed any more, so old versions of those packages (a.k.a. cache entries) will be removed if any exist."
It might just be me. I'll admit that I didn't read the pacman manual top-to-bottom, but maybe some more explicit documentation of -Sc and -Scc wouldn't hurt.
Every update of the packages you have already installed is a different package.
When you update a package, the previous versions of the package are consider "uninstalled."
This is because pacman automatically removes the files from the previously package and replaces them by extracting the files from the new package with the exception to saving the old config files with *.pacnew.
All the packages that pacman downloads from the mirrors, gets stored in a cache directory such as /var/cache/pacman/pkg/.
Technically all packages are considered cache, because you can always reuse them when you have to reinstall or downgrade a package.
Last edited by Acecero (2010-08-11 23:42:30)
Offline
Thanks for the replies and insight, mcmillan and Acecero.
It's interesting to see things from pacman's mindset, but I would still argue that there is a little ambiguity, as mcmillan seems to confirm. I'll try to make some clarifications on the Wiki soon (as long as people are happy with that), and might submit an issue for the pacman maintainers about potentially clarifying the language in the manual (again, only if people on here agree that it would make sense to do that).
Offline
Removing ambiguity is always a good idea; helping to make the Arch documentation as KISS as the distro is an important contribution - I'm sure your input would be welcomed.
Offline