[Mageia-dev] Utter frustration
Liam R E Quin
liam at holoweb.net
Sun Nov 25 18:22:21 CET 2012
On Sun, 2012-11-25 at 14:01 +0000, Anne Wilson wrote:
> > Since there's no identification in the message, all I could suggest
> > is a brute-force search of all files on the root or /usr partitons
> > for the string "ConsoleKit", which appears in the error message.
> > Then, identify the package which owns the file using rpmdrake.
> >
> Makes sense. The only problem is I don't know how to do that. I
> tried to use a combination of cat and grep, but there is no recursive
> flag, so that won't work. How would you do it?
(1) grep -l -r ConsoleKit .
this is easiest; -r is "recursive" But it will cross file system
boundaries, so if you do it from / it will go into /use and /media
and anywhere else it can find!
(2) find / /usr -type f -xdev -print0 | xargs -0 grep -l ConsoleKit
This is the usual "find" approach.
-type f means only print names of files, not directories, symbolic
links or device files...
-xdev means don't stray into other filesystems like /home
-print0 is the same as -print (prints each matching name) but prints
the filenames with a NUL (character 0, hence the 0 in -print0)
after each name, instead of putting each file on a separate line.
This is needed because of filenames containing spaces or newlines.
xargs reads a list of files, one per line, or, with -0 (again the
digit zero) separated by NUL bytes; it runs the command on each of
the files
The -l option to grep says to print just the filename, needed in
case there are binaries that contain the string.
Liam
--
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml
Co-author, 5th edition of "Beginning XML", Wrox, 2012
More information about the Mageia-dev
mailing list