• Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate
TecNStuff
Menu
  • Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate

How to List Installed Packages on Ubuntu

Written by Admin, Updated On July 26, 2019
apt, dpkg, ubuntu
List Installed Packages on Ubuntu

It is always useful to you if you know which packages are installed on your system. You can install same packages on another system if you know how to check installed package on your current Ubuntu system or you can re-install. In this tutorial described how to list installed packages on Ubuntu, whether a specific package is installed, count of installed packages and check version of installed packages.

Instructions of this article apply for any Ubuntu based distribution, including Linux Mint, Kubuntu and Elementary OS.

List Installed Packages#

In Ubuntu system apt is a package manager which have command-line interface to manage packages. You can list installed packages using apt command. For get list of installed packages on Ubuntu, execute the following command in terminal:

sudo apt list --installed

In output it will show a list of installed packages along with the version and architecture of package as given below:

ubuntu list installed packages with apt

Generally, packages list will be long so it would better to see list using pipe and make output less and easier to read:

sudo apt list --installed | less

If you want to find any specific package is installed or not, you can filter combine grep command along with the apt command. For example, if you want check Google Chrome is installed on your Ubuntu system or not, then run below command:

sudo apt list --installed | grep google-chrome
Output
google-chrome-stable/now 75.0.3770.100-1 amd64 [installed]

List Installed Packages with dpkg-query#

You can easily check the installed package from the dpkg command database using dpkg-query command. This command is useful for who are running older Ubuntu version. Run the below command to list all the installed packages:

sudo dpkg-query -l | less
ubuntu list installed packages with dpkg query

From above output you can see version, description and architecture of the packages.

Also, same as apt, you can use grep command to filter package with dpkg-query -l command:

sudo dpkg-query -l | grep google-chrome

The output should show as below:

Output
google-chrome-stable/now 75.0.3770.100-1 amd64 [installed]

Export List of Installed Packages#

You can list the installed package on your Ubuntu system and export as a file using apt command. Execute the following command to export list of all installed packages on your Ubuntu system:

sudo apt list --installed > installed_packages.txt

You also can export the installed packages using dpkg-query command as given below:

sudo dpkg-query -f '${binary:Package}\n' -W > installed_packages.txt

Now, you can use this exported file to install these packages to your another system. Run the below command to install those packages:

sudo xargs -a installed_packages.txt apt install

How to count number of packages installed#

You can get count number of installed packages using the below command:

dpkg --list | wc --lines

It should show output as below:

Output
2008

In above output you can see 2008 packages installed on my Ubuntu system.

Conclusion#

You successfully learned how to list installed package and find specific installed package on your Ubuntu system.

If you have any questions or suggestion, please leave a comment below.

If our content helps you, please consider buying us a coffee

Thank you for your support.

Share On
Share on Facebook
Share on Twitter
Share on Reddit
Share on Tumblr
 Previous Article How to Install Ruby on CentOS 7
Next Article   How to Install PostgreSQL on Debian 10

Related Posts

  • How to Install and Use PHP Composer on Ubuntu 22.04

    How to Install Composer on Ubuntu 22.04

    January 31, 2023
  • How to Install Nginx on Ubuntu 22.04

    How to Install Nginx on Ubuntu 22.04

    January 28, 2023
  • How to Install Puppet Agent on Ubuntu 22.04

    How to Install Puppet Agent on Ubuntu 22.04

    January 22, 2023

1 Comment

  1. Leon S Reply
    April 8, 2021 at 6:54 pm

    Excelente explicación. Con el sudo dpkg -l > paquetes.txt también exportar los nombres de todos los paquetes instalados

Leave a Reply Cancel reply

DigitalOcean Referral Badge

Popular Posts

  • How to Install SSH Keys on Ubuntu 22.04
    How to Set up SSH Keys on Ubuntu 22.04 January 7, 2023
  • How to Install Mongodb on Debian 11
    How to Install MongoDB on Debian 11 Linux January 11, 2023
  • How to Install Puppet Agent on Ubuntu 22.04
    How to Install Puppet Agent on Ubuntu 22.04 January 22, 2023
  • How to Install Jenkins on Debian 11
    How to Install Jenkins on Debian 11 January 5, 2023
  • How to Change-Hostname Ubuntu 22.04
    How to Change Hostname on Ubuntu 22.04 January 19, 2023
© 2020 TecNStuff All rights reserved. This website is using and storing cookies on your browser. By using this website you agree our Privacy Policy.  Follow us -  Twitter | Facebook