Thursday, August 23, 2012

say what, yum? #linux #devops





Linux generally doesn't pretend to be user friendly.  Geeks love linux just for that. This is an example of linux moving from geeky to dorky.
Warning: 3.0.x versions of yum would erroneously match against filenames.
 You can use "*/cantfindit" and/or "*bin/cantfindit" to get that behaviour

That's the error message you get when using 'yum provides' to find a package.  The complete output is:
# yum provides thatpackage
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.metrocast.net
 * epel: mirror.metrocast.net
 * extras: mirror.cogentco.com
 * updates: mirror.metrocast.net
Warning: 3.0.x versions of yum would erroneously match against filenames.
 You can use "*/thatpackage" and/or "*bin/thatpackage" to get that behaviour
No Matches found

so what does this mean?  I mean... I didn't much use yum 3.0.x, so what does this have to do with me?

Here's what yum -h says about the 'provides' option
provides       Find what package provides the given value
hmmm... not so much help.  How about 'man'?
provides or whatprovides
Is  used  to find out which package provides some feature or file. Just use a specific name or a file-glob-syntax wildcards to list the packages available or installed  that provide that feature or file.
Say what?  "Just use a specific name or a file-glob-syntax wildcards..."


Yum is trying say, in a particularly obtuse way, "try using */thatpackage and/or *bin/thatpackage."  When you use the wildcard in this fashion (what they are evidently calling the file-glob-sytanx wildcards) yum will search both the package name AND the filename.  By default it only searches the package name, which often is not particularly helpful when trying to find a package or when you're trying to resolve a dependency.  Searching for the filename IS a pretty useful feature.  Perhaps the docs could have explained it a little better.  Just sayin.