LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 12-10-2009, 07:58 AM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Rep: Reputation: 83
equivalents of dpkg -l | grep ^ii | awk '{print $2, $3}'


Hi!

Could you provide me with equivalents of this commands on rpm-based and portage-based distros?

dpkg -l | grep ^ii | awk '{print $2, $3}'

I need them for flisys: code.launchpad.net/~eantoranz/+junk/flisys

Did I leave out a big package manager outside?

And do BSD "distros" (or whatever they are called) have package management software to get tha info? Do they have lsb-release or something like that?

Thanks in advance!
 
Old 12-10-2009, 10:40 AM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 163Reputation: 163
Pretty much does the same as dpkg -l for rpm based distributions
Code:
rpm -qa
Gentoo's portage isn't natively able to list all packages it has installed (or wasn't last I had it installed) you need to install gentoolkit and if memory serves me the command is

Code:
qpkg -I
It was based off freebsd's ports system... which I don't recall the commands for right off the top of my head to list packages.

Edit: google to the rescue

Last edited by rweaver; 12-10-2009 at 10:43 AM.
 
Old 12-10-2009, 06:52 PM   #3
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
See also http://kbase.redhat.com/faq/docs/DOC-2531
 
Old 09-03-2011, 08:54 PM   #4
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
This should work

For RPM-based distros, it will take much more cpu time than the debian solution, but the output will be the same:

Code:
rpm -qa | while read package; do rpm -qi $package | head -n 1 | while read a b c; do echo -n "$c "; done; rpm -qi $package | head -n 2 | tail -n 1 | while read a b c; do echo $c; done; done

Last edited by eantoranz; 09-03-2011 at 09:00 PM.
 
Old 09-04-2011, 05:50 AM   #5
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950
By the way, awk, being a full text processing language, already has grep-like ability, so you can skip an entire pipe.

Code:
dpkg -l | awk '/^ii/ {print $2, $3}'
 
  


Reply

Tags
managers, package


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
grep and awk error bazzano Programming 2 04-06-2009 01:01 AM
cat|grep|awk pudhiyavan Programming 6 07-14-2008 02:56 AM
How do you do ps ax | grep mozilla | awk '{print "kill " $1}' pppaaarrrkkk Programming 4 03-19-2008 08:17 PM
Help with Bash (grep/awk/etc) piercey Programming 12 02-27-2008 11:21 AM
Can I use grep inside awk? Helene Programming 6 04-27-2004 01:58 AM


All times are GMT -5. The time now is 05:07 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration