You are not logged in.
Hi,
I've been thinking about this for some time, and tried to find the answer on the forum to no avail. So, the question is this: does pacman ever check the consistency of dependencies among all the installed packages?
The reason for my asking is mostly due to the existence of the --nodeps option when removing packages. I think the answer to my question is "no", since I just tested it by removing wget (needed by hwd and abcde on my system) with the --nodeps option, and then did a pacman -Syu. pacman did not see that a dependency was missing - not very surprisingly, since the packages depending on wget were up to date.
Now, is there any option that makes pacman do a full dependency check on the system? If there isn't, I would very much welcome one. Or, perhaps even better IMO, if pacman did that when doing a full system upgrade (-Su) - at least that it notified the user that some dependencies were missing (if any) and asked whether the user wanted to install them.
Since I haven't found an existing tool to this end, I wrote a python script for this some time ago; chkpkgs.py. Sorry if the code isn't up to python standards - I'm still learning
EDIT: Changed the subject to something smarter
EDIT 2: Posted an updated version of chkpkgs.py in the pastebin. Now it does not use the REQUIREDBY field, but creates this info from the DEPENDS info.
Last edited by Bebo (2007-07-04 07:57:40)
Offline
Hm, could you also post this on pacman-dev ML ?
I think there are more people knowing pacman there
Anyway, that --nodeps option is indeed problematic, since it breaks the db. I also don't think pacman can detect or repair these broken dependencies, but I'm not even sure. That idea is probably worth discussing.
Btw, your script finds three more package in provided/unrequired than the option there :
http://bugs.archlinux.org/task/7208
which just prints package with an empty RequiredBy.
So looks like I've three broken entries in my local database (which have a RequiredBy field non empty, while it should be empty).
pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))
Offline
I don't think pacman does this yet, though it would be a good feature to be able to scan the local DB for inconsistencies - it's been talked about before, in any case, and recently iirc.
However, I don't think it should be the default behavior during an -Su operation - if a user removed a package with the --nodeps flag, then it's assumed the user knew what they were doing. It would be very aggravating if pacman "knew better" than the user, and automatically re-installed these deps that the user doesn't want on every upgrade.
Last edited by Cerebral (2007-07-03 16:46:43)
Offline
shining, yes, --nodeps is problematic as you say, in that exact way. I'm not sure what you mean by you finding 3 more provided/unrequired packages though; is there a bug in my script? The provided/unrequired just means that they are installed ("provided" by the set of currently installed packages) but have nothing that depends on _them_. (They have probably pulled some dependencies though.)
Cerebral, I completely agree with you - pacman should not decide to do anything like that on its own. You should be able to wreck your system, if that's what you want It's just that if one fiddles around with the packages too much, and uses pacman -Rd too recklessly and forget what packages one removed, it would be good to have a means to check the db consistency when the dust has settled.
Offline
Just a remark on the script; it is one or two months old and I had to recall what I had done, to better answer shining's comment. The requiredby information is _only_ used to find the "solitary" packages, i.e. those that don't depend on any other package && are not required by any other package. The provided/unrequired and required/unprovided packages are found only by looking at what packages are installed on the system and the dependencies of each installed package. (Maybe it would be better to find the solitary packages by this info alone, too. I'll see if I get around to it, some time )
Offline
Just a remark on the script; it is one or two months old and I had to recall what I had done, to better answer shining's comment. The requiredby information is _only_ used to find the "solitary" packages, i.e. those that don't depend on any other package && are not required by any other package. The provided/unrequired and required/unprovided packages are found only by looking at what packages are installed on the system and the dependencies of each installed package. (Maybe it would be better to find the solitary packages by this info alone, too. I'll see if I get around to it, some time )
As you said your script computes the RequiredBy field again, but this information is already in the local db, example :
pacman -Qi filesystem | grep Required
Required By : fakeroot hal slocate
pacman uses this information for finding which packages are not required by any others, while your script does not.
So they find nearly the same result, except for 3 packages. But I believe it's my database which is broken, and that for these 3 packages, the RequiredBy field is wrong :
LANG=C pacman -Qi libnetworkmanager pkgconfig xulrunner | grep -E "Name|Required"
Name : libnetworkmanager
Required By : pidgin
Name : pkgconfig
Required By : sshfs
Name : xulrunner
Required By : kazehakase
LANG=C pacman -Qi pidgin sshfs kazehakase | grep -E "Name|Depends"
Name : pidgin
Depends On : startup-notification gtkspell libxss gstreamer0.10
Name : sshfs
Depends On : fuse glib2 openssh
Name : kazehakase
Depends On : osb-browser-svn osb-jscore-svn osb-nrcit-svn
eg libnetworkmanager is required by pidgin, but pidgin doesn't depend on anything related to libnetworkmanager, as far as I can tell. Same for two others.
Since your script doesn't use the RequiredBy field, but compute it, it shows these 3 packages : libnetworkmanager, pkgconfig and xulrunner.
Is this more clear (I'm not sure ) ?
pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))
Offline
Okay, I see what you mean. I've rewritten the script a bit now, so it does not need the requiredby info at all, but only the depends info. However, the script is in an in-between state now, so it knows about both. What with your "odd" local db, could you please test the script at http://pastebin.archlinux.org/7679 and just show me what it says? I _think_ it will detect the errors, but I'm not sure. The script will be in the pastebin for a day.
Offline
Okay, I see what you mean. I've rewritten the script a bit now, so it does not need the requiredby info at all, but only the depends info. However, the script is in an in-between state now, so it knows about both. What with your "odd" local db, could you please test the script at http://pastebin.archlinux.org/7679 and just show me what it says? I _think_ it will detect the errors, but I'm not sure. The script will be in the pastebin for a day.
Hm no, it didn't : http://pastebin.archlinux.org/7695
pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))
Offline
Okay, thanks a lot for testing. I'll just remove the requiredby stuff then, it's, er, obsolete
Offline
Posted an updated version of the chkpkgs.py script: http://pastebin.archlinux.org/7809
Offline
Erm, what I said earlier about your original script is totally wrong.
I thought you didn't use the requiredby info from the database in your script, and that would explain the difference. But your script did use requiredby...
Maybe it has to do with how it used this information then, maybe not totally blindly.
pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))
Offline
Well, the script used requiredby _only_ for getting the solitary packages, it has never used that info for the other cases. The latest version doesn't use the requiredby info at all.
Offline
Oh I see, I get it now Well, it would still be interesting to find the inconsistencies, like you tried earlier
And as I said in my first reply, some people might read the pacman-dev ML but not this forum, so consider bringing this topic there.
pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))
Offline