The problem is the underscore. TeX uses that as a special character to denote subscripts, as in x_1,x_2. TeX assumes that wherever it encounters an underscore the author means it to be a subscript.
Fortunately, this behaviour can be overridden. Even more fortunately, you don't need to know how this is done since it is already solved for you! LaTeX provides the \verb (short for "verbatim") command which typesets its contents in the \texttt family and sorts out all the "special" characters so that they appear as is. A way to use it for you would be:
\verb+2.6.40.4-5.fc15.x86_64+
The + is a delimiter that you yourself can choose, so if the string has + in it then you can choose something else, such as *. Just make sure that the delimiter is not something that appears in the string that you want to typeset.