List installed packages on Linux or FreeBSD / OpenBSD system

Q. How do I list all installed packages on Linux or FreeBSD system?

A. Most Linux distributions are based upon rpm or apt-get / dpkg packaging system.

RedHat, Fedora Core, Suse Linux, Cento os all are RPM based distribution

Use rpm command as follows to list all installed packages
rpm -qa
rpm -qa | grep ‘package-name’
rpm -qa | grep -i ‘*httpd*’

Debian or Ubuntu Linux distribution

You can use dpkg command to list all installed packages:
dpkg –list
dpkg –list | grep ‘package-name’
dpkg –list | grep -i ‘*php*’

Task: OpenBSD list installed package

Use pkg_info command for displaying information on all installed software packages
$ pkg_info
$ pkg_info | grep ‘package-name’

Output:

bash-3.1.10_1       The GNU Project's Bourne Again SHell
expat-2.0.0_1       XML 1.0 parser written in C
gettext-0.14.5_2    GNU gettext package
lftp-3.4.0_3        Shell-like command line ftp client
libiconv-1.9.2_2    A character set conversion library
libstatgrab-0.12_1  Provides a useful interface to system statistics
nmap-4.01           Port scanning utility for large networks
pcre-6.6_1          Perl Compatible Regular Expressions library
pkgconfig-0.20      A utility to retrieve information about installed libraries
vim-lite-6.4.6_1    Vi "workalike", with many additional features (Lite package

Task: FreeBSD list installed package

Use pkg_info command as described above.


🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 10 comments so far... add one


CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
10 comments… add one
  • mr_gfd Apr 30, 2010 @ 19:33

    FreeBSD: pkg_info -Ix ‘any-part-of-package-name’

    • DeaDSouL Jun 14, 2016 @ 14:50

      +1
      Thanks

  • Lokendra Patidar Apr 13, 2011 @ 11:55

    Thanks a lot for help.
    Really it helped lots.

  • pio11 May 4, 2011 @ 11:20

    For packages management better is dselect. It can list, display status and choose packages for install/reinstall/uninstall.

  • bharat May 13, 2011 @ 9:20

    how to download redhat packages ………..

  • tarique Feb 17, 2012 @ 9:07

    hiiii………….
    how to know the default installed package in ltib?
    please reply sir……….

  • Kevin Sep 18, 2012 @ 23:43

    FWIW, Arch Linux: pacman -Qqe

  • Anurag kumar Jul 1, 2014 @ 9:08

    thanks for this useful info :)

  • Jim S. Aug 2, 2014 @ 2:28

    WOW!

    Thanks for this helpful post. Could not have come in handy at a better time. I am in the process of moving all of my projects and other stuff onto another computer. So this really helped me a lot.

    BTW: For those who may not know, adding a ” > /dir/filename.ext ” at the end of the command will output to a text file so that you may print out a hardcopy if needed. – Just thought a little bit more useful info will help.

    – Jim S.

  • Ivan Mar 25, 2015 @ 10:44

    For FreeBSD things changed a little. Use pkg info. Consult man pkg for further information.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum