LinuxQuestions.org
Review your favorite Linux distribution.
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, 06:58 AM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
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, 09:40 AM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
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 09:43 AM.
 
Old 12-10-2009, 05:52 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,354

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
See also http://kbase.redhat.com/faq/docs/DOC-2531
 
Old 09-03-2011, 07:54 PM   #4
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
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 08:00 PM.
 
Old 09-04-2011, 04:50 AM   #5
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
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
Can I use grep inside awk? Helene Programming 10 09-29-2015 08:48 PM
grep and awk error bazzano Programming 2 04-06-2009 12:01 AM
cat|grep|awk pudhiyavan Programming 6 07-14-2008 01:56 AM
How do you do ps ax | grep mozilla | awk '{print "kill " $1}' pppaaarrrkkk Programming 4 03-19-2008 07:17 PM
Help with Bash (grep/awk/etc) piercey Programming 12 02-27-2008 10:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:01 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