LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-23-2006, 10:36 AM   #1
sang_froid
Member
 
Registered: Oct 2006
Posts: 179

Rep: Reputation: 15
extracting rpm list from a file


Hi
I have a file containing the list of rpms as below:
I would like to extract the rpm ( excluding the version details)

My problem is if the list simply contained rpms like

4Suite-1.0-3
acl-2.2.23-5
alchemist-1.0.34-1
anacron-2.3-32
apmd-3.0.2-24
automake14-1.4p6-12
automake15-1.5-13
automake16-1.6.3-5
automake17-1.7.9-5
elfutils-libelf-0.97-5
emacs-common-21.3-19.EL
fonts-xorg-base-6.8.1-1
and so on... If it contained the entries only like

4Suite-1.0-3
acl-2.2.23-5
alchemist-1.0.34-1,
then it would not have been a problem as i can grep the first field using - as a delimiter. But here as it has other entries like

automake17-1.7.9-5
elfutils-libelf-0.97-5
emacs-common-21.3-19.EL
fonts-xorg-base-6.8.1-1

It is not possible to do so. ( In the case of automake17-1.7.9-5), I simply need the output as automake.

How do I do it ? Your help will be highly appreciated
Thank you
 
Old 10-23-2006, 10:41 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well something like "rpm -qa --queryformat '%{NAME}\n' " will list all package names of packages on the system i.e. without the version number, but as far as automake goes, the package name IS automake17... i think you're getting a little lost just becuase it contains a number. automake versions happily live side by side so you can't just say it's "automake" necessarily. this is simllar to the way that gtk2 is *NOT* gtk.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Get rpm package file list and config informations tobiasw Linux - Newbie 1 10-22-2006 05:39 PM
Extracting '.rpm' in YaST. rlhanson Linux - Newbie 3 03-26-2006 10:57 PM
Extracting rpm files vsouza Linux - Software 5 10-08-2004 01:31 PM
extracting 1 file from RPM sopiaz57 Linux - General 3 04-09-2004 03:22 PM
Extracting files from an rpm or srpm MRK Linux - Software 2 11-27-2003 11:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration