Or, if you are using bash then you could use bash's own String manipulation mechanism, e.g.
: Just saw your latest post. So is it correct to assume that this line is inside a file and not stored in a variable?
In this case:
sed 's/\.rpm.*$//' inputfile
You might have to provide a representative sample of you input data.