{"id":15687,"date":"2019-02-27T14:10:53","date_gmt":"2019-02-27T14:10:53","guid":{"rendered":"https:\/\/www.hostinger.com\/tutorials\/?p=15687"},"modified":"2026-03-09T19:19:44","modified_gmt":"2026-03-09T19:19:44","slug":"how-to-list-installed-packages-on-ubuntu","status":"publish","type":"post","link":"\/ng\/tutorials\/how-to-list-installed-packages-on-ubuntu","title":{"rendered":"How to list installed packages on Ubuntu"},"content":{"rendered":"<?xml encoding=\"utf-8\" ?><p>As a server administrator, understanding how to list software packages installed in an Ubuntu system is crucial. It is useful for various tasks, such as software inventory tracking, updating, and migrating a hosting environment.<\/p><p>There are several commands for Linux server package management. In addition to having different purposes, these commands vary depending on your operating system version and package manager.<\/p><p>In this article, we will explain how to use commands in Ubuntu to list installed packages. We will explore different methods and command variations for different tasks.<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/Linux-Commands-Cheat-Sheet.pdf\"><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"566\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/public\" alt=\"\" class=\"wp-image-69262\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/w=2048,fit=scale-down 2048w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/a><\/figure><\/div><p>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-list-installed-packages-on-ubuntu\">How to List Installed Packages on Ubuntu<\/h2><p>Let&rsquo;s go over the common methods to list installed packages on an <a href=\"\/ng\/tutorials\/what-is-ubuntu\">Ubuntu<\/a> <strong>22.04 <\/strong>system. Before proceeding, ensure your <a href=\"\/ng\/vps\/ubuntu-hosting\">Ubuntu VPS<\/a> is running the same or a later version or the commands won&rsquo;t work.<\/p><h3 class=\"wp-block-heading\" id=\"h-how-to-list-installed-packages-on-ubuntu-using-apt\">How to List Installed Packages on Ubuntu Using apt<\/h3><p>Ubuntu version <strong>14.04<\/strong> and later comes with the <strong>apt<\/strong> package management system. In these versions, you can use the <strong>apt <\/strong>command-line utility to list the software packages installed on your system. If you&rsquo;re unsure which version of Ubuntu you&rsquo;re running, check out our article to learn <a href=\"\/ng\/tutorials\/how-to-check-ubuntu-version\">how to check your Ubuntu version<\/a>.<\/p><p>Use Terminal to execute the <a href=\"\/ng\/tutorials\/linux-commands\">Linux commands<\/a> in a local system. For a remote machine like a VPS, you must connect via SSH <a href=\"\/ng\/tutorials\/how-to-use-putty-ssh\">using PuTTY<\/a> or Terminal.<\/p><p>Hostinger VPS hosting users can obtain the login credentials from the VPS overview&rsquo;s <strong>SSH access tab<\/strong>.<\/p><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-large\"><a class=\"hgr-tutorials-cta hgr-tutorials-cta-vps-hosting\" href=\"\/ng\/vps-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/public\" alt=\"\" class=\"wp-image-77934\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><p>Alternatively, Hostinger users can leverage the <a href=\"https:\/\/support.hostinger.com\/en\/articles\/7978544-how-to-use-the-browser-terminal\">Browser terminal<\/a> for command-line package listing directly through their web browser. Once connected, run the following commands to list packages with <strong>apt<\/strong>.<\/p><p>Use the <strong>apt list <\/strong>command to show all the available <strong>Ubuntu 22.04<\/strong> packages:<\/p><pre class=\"wp-block-preformatted\">sudo apt list<\/pre><p>To list only installed packages, run the <strong>apt list <\/strong>command with the <strong>&ndash;installed <\/strong>option:<\/p><pre class=\"wp-block-preformatted\">sudo apt list &ndash;-installed<\/pre><p>Add the <strong>less<\/strong> argument to show a smaller output. To do so, append a pipe (<strong>|<\/strong>) and <strong>less <\/strong>at the end of your command:<\/p><pre class=\"wp-block-preformatted\">sudo apt list &ndash;-installed | less<\/pre><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/02\/Apt-command-outputting-the-shortened-list-of-installed-packages.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1190\" height=\"333\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/Apt-command-outputting-the-shortened-list-of-installed-packages.png\/public\" alt=\"Apt command outputting the shortened list of installed packages\" class=\"wp-image-93206\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/Apt-command-outputting-the-shortened-list-of-installed-packages.png\/w=1190,fit=scale-down 1190w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/Apt-command-outputting-the-shortened-list-of-installed-packages.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/Apt-command-outputting-the-shortened-list-of-installed-packages.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/Apt-command-outputting-the-shortened-list-of-installed-packages.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/Apt-command-outputting-the-shortened-list-of-installed-packages.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1190px) 100vw, 1190px\" \/><\/a><\/figure><\/div><p>While <strong>less<\/strong> displays output one screen at a time, it will still list all the installed packages, allowing you to scroll up and down through them. Type <strong>q<\/strong> to exit.<\/p><p>To check if a package is installed, use the <strong>grep<\/strong> command with the software name:<\/p><pre class=\"wp-block-preformatted\">sudo apt list --installed | grep packagename<\/pre><p>To view more information about a specific package installed on your system, use the <strong>apt show<\/strong> command:<\/p><pre class=\"wp-block-preformatted\">sudo apt show packagename<\/pre><p>Remember to replace the <strong>packagename <\/strong>placeholder with the specific package name. For example, run these commands to list <strong>Vim<\/strong>-related packages:<\/p><pre class=\"wp-block-preformatted\">sudo apt list --installed | grep vim<\/pre><p>To display detailed information about a particular<strong> Vim<\/strong> package, run the following:<\/p><pre class=\"wp-block-preformatted\">sudo apt show vim<\/pre><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/02\/The-apt-show-command-outputting-an-information-about-the-vim-package.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1190\" height=\"313\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-apt-show-command-outputting-an-information-about-the-vim-package.png\/public\" alt=\"The apt show command outputting an information about the vim package\" class=\"wp-image-93207\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-apt-show-command-outputting-an-information-about-the-vim-package.png\/w=1190,fit=scale-down 1190w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-apt-show-command-outputting-an-information-about-the-vim-package.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-apt-show-command-outputting-an-information-about-the-vim-package.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-apt-show-command-outputting-an-information-about-the-vim-package.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-apt-show-command-outputting-an-information-about-the-vim-package.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1190px) 100vw, 1190px\" \/><\/a><\/figure><\/div><h3 class=\"wp-block-heading\" id=\"h-how-to-use-dpkg-query-to-list-installed-packages-on-ubuntu\">How to Use dpkg-query to List Installed Packages on Ubuntu<\/h3><p>For older versions of Ubuntu without the <strong>apt<\/strong> package manager, use the <strong>dpkg-query<\/strong> command. <strong>Dpkg-query <\/strong>usage is similar to <strong>apt <\/strong>but doesn&rsquo;t work with a remote repository.<\/p><p>To list only installed packages with their versions and a brief description, run the following command:<\/p><pre class=\"wp-block-preformatted\">sudo dpkg -l<\/pre><p>If you have a Hostinger VPS plan, you can also use <strong>Kodee<\/strong> to list the installed packages on your Ubuntu server. Please note that due to the extensive list, it will only display a limited number of results:<\/p><div class=\"wp-block-image\"><figure data-wp-context='{\"imageId\":\"69e1b3b1864dd\"}' data-wp-interactive=\"core\/image\" class=\"aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/02\/hpanel-vps-kodee-package-1024x598.png\" alt=\"Kodee responds to a question about listing installed packages on the VPS\"><button class=\"lightbox-trigger\" type=\"button\" aria-haspopup=\"dialog\" aria-label=\"Enlarge\" data-wp-init=\"callbacks.initTriggerButton\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-style--right=\"state.imageButtonRight\" data-wp-style--top=\"state.imageButtonTop\">\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewbox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\"><\/path>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div><p>Use <strong>less<\/strong> with the <strong>dpkg <\/strong>command to restrict the output like the following:<\/p><pre class=\"wp-block-preformatted\">sudo dpkg -l | less<\/pre><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/02\/The-dpkg-query-command-outputting-the-shortened-list-of-installed-packages.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1224\" height=\"440\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-dpkg-query-command-outputting-the-shortened-list-of-installed-packages.png\/public\" alt=\"The dpkg-query command outputting the shortened list of installed packages\" class=\"wp-image-93209\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-dpkg-query-command-outputting-the-shortened-list-of-installed-packages.png\/w=1224,fit=scale-down 1224w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-dpkg-query-command-outputting-the-shortened-list-of-installed-packages.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-dpkg-query-command-outputting-the-shortened-list-of-installed-packages.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-dpkg-query-command-outputting-the-shortened-list-of-installed-packages.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-dpkg-query-command-outputting-the-shortened-list-of-installed-packages.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1224px) 100vw, 1224px\" \/><\/a><\/figure><\/div><p>Add <strong>grep<\/strong> to search for specific packages. Here&rsquo;s how the command looks:<\/p><pre class=\"wp-block-preformatted\">sudo dpkg -l | grep packageName<\/pre><p>Remember to replace <strong>packageName <\/strong>with the actual package. For example, enter the following to show installed packages related to PHP:<\/p><pre class=\"wp-block-preformatted\">sudo dpkg -l | grep PHP<\/pre><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/02\/The-dpkg-query-command-listing-installed-PHP-related-packages.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1233\" height=\"268\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-dpkg-query-command-listing-installed-PHP-related-packages.png\/public\" alt=\"The dpkg-query command listing installed PHP-related packages\" class=\"wp-image-93210\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-dpkg-query-command-listing-installed-PHP-related-packages.png\/w=1233,fit=scale-down 1233w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-dpkg-query-command-listing-installed-PHP-related-packages.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-dpkg-query-command-listing-installed-PHP-related-packages.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-dpkg-query-command-listing-installed-PHP-related-packages.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-dpkg-query-command-listing-installed-PHP-related-packages.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1233px) 100vw, 1233px\" \/><\/a><\/figure><\/div><p>In addition, you can query information about a specific package using <strong>dpkg-query<\/strong>. Here&rsquo;s the command:<\/p><pre class=\"wp-block-preformatted\">sudo dpkg-query -W packageName<\/pre><h3 class=\"wp-block-heading\" id=\"h-how-to-create-a-list-of-installed-packages-on-ubuntu\">How to Create a List of Installed Packages on Ubuntu<\/h3><p>In addition to listing installed software, you may need to save the results for archiving or system configuration replication. Ubuntu lets you use the redirect output symbol (<strong>&gt;<\/strong>) to store the installed package names into a file.<\/p><p>To do so, use<strong> dpkg-query <\/strong>to request information from the <strong>dpkg <\/strong>package manager about the installed applications. Then, add <strong>-f &lsquo;${binary:Package}n&rsquo; -W<\/strong> to specify the output format.<\/p><p>End the command with the <strong>&gt; <\/strong>symbol to inform where it should store the result, namely the <strong>completePackage.txt<\/strong> file. Here&rsquo;s what the complete command looks like:<\/p><pre class=\"wp-block-preformatted\">sudo dpkg-query -f '${binary:Package}n' -W &gt; completePackage.txt<\/pre><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/02\/The-list-of-installed-packages-in-the-complatepackage.txt-file.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1180\" height=\"459\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-list-of-installed-packages-in-the-complatepackage.txt-file.png\/public\" alt=\"The list of installed packages in the complatepackage.txt file\" class=\"wp-image-93211\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-list-of-installed-packages-in-the-complatepackage.txt-file.png\/w=1180,fit=scale-down 1180w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-list-of-installed-packages-in-the-complatepackage.txt-file.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-list-of-installed-packages-in-the-complatepackage.txt-file.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-list-of-installed-packages-in-the-complatepackage.txt-file.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-list-of-installed-packages-in-the-complatepackage.txt-file.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1180px) 100vw, 1180px\" \/><\/a><\/figure><\/div><p>Alternatively, use the <strong>&ndash;get-selections <\/strong>option to retrieve the packages based on their installation status. Here&rsquo;s the command:<\/p><pre class=\"wp-block-preformatted\">sudo dpkg --get-selections &gt; completePackage.txt<\/pre><p>Creating package lists is also helpful for replicating the installed applications on other machines. To do so, move <strong>completePackage.txt<\/strong> to the new system and run this command:<\/p><pre class=\"wp-block-preformatted\">sudo xargs -a completePackage.txt apt install<\/pre><p>The <strong>xargs <\/strong>command reads the list from the <strong>completePackage.txt <\/strong>file. Then, the Linux software installation<strong> <\/strong>command adds the same packages to the new system.<\/p><p>You can also use the <strong>apt <\/strong>command for package replication on Linux. To list the installed packages in a file, use the command below:<\/p><pre class=\"wp-block-preformatted\">sudo apt list --installed | awk -F\/ -v ORS=\" \" 'NR&gt;1 {print $1}' &gt; completePackage.txt<\/pre><p>After adding the file to another server, install the same packages using the <strong>apt-get<\/strong> commands:<\/p><pre class=\"wp-block-preformatted\">sudo apt-get install &lt; completePackage.txt<\/pre><h3 class=\"wp-block-heading\" id=\"h-how-to-count-the-installed-packages-on-ubuntu\">How to Count the Installed Packages on Ubuntu<\/h3><p>You can also count the number of installed Linux packages. The syntax is similar to the one for outputting the list to a file but with a <strong>wc <\/strong>or <strong>word count <\/strong>command after the pipe.<\/p><p>This<strong> <\/strong>command will check the installed packages based on the specified options. In this case, we use the <strong>-l <\/strong>option to count the number of lines in your installed package list:<\/p><pre class=\"wp-block-preformatted\">sudo dpkg-query -f '${binary:Package}n' -W | wc -l<\/pre><p>Here&rsquo;s what the output will look like:<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/02\/dpkg-query-outputs-the-number-of-installed-packages.png\"><img loading=\"lazy\" decoding=\"async\" width=\"962\" height=\"43\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/dpkg-query-outputs-the-number-of-installed-packages.png\/public\" alt=\"dpkg-query outputs the number of installed packages\" class=\"wp-image-93212\" style=\"width:840px;height:37px\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/dpkg-query-outputs-the-number-of-installed-packages.png\/w=962,fit=scale-down 962w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/dpkg-query-outputs-the-number-of-installed-packages.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/dpkg-query-outputs-the-number-of-installed-packages.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/dpkg-query-outputs-the-number-of-installed-packages.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 962px) 100vw, 962px\" \/><\/a><\/figure><\/div><p>For counting installed packages, you can also use the <strong>wc <\/strong>command with <strong>apt<\/strong>:<\/p><pre class=\"wp-block-preformatted\">sudo apt list &ndash;-installed | wc -l<\/pre><h3 class=\"wp-block-heading\" id=\"h-how-to-list-upgradeable-packages\">How to List Upgradeable Packages<\/h3><p>Add the <strong>&ndash;upgradeable<\/strong> option to your <strong>apt <\/strong>command to check the available updates in the repository. Before proceeding, sync the repository using this command:<\/p><pre class=\"wp-block-preformatted\">sudo apt update<\/pre><p>Then, run the following command for upgradable package detection:<\/p><pre class=\"wp-block-preformatted\">sudo apt list --upgradeable<\/pre><p>Terminal&rsquo;s output will be similar to this:<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/02\/The-apt-command-listing-all-available-package-updates.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1222\" height=\"224\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-apt-command-listing-all-available-package-updates.png\/public\" alt=\"The apt command listing all available package updates\" class=\"wp-image-93213\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-apt-command-listing-all-available-package-updates.png\/w=1222,fit=scale-down 1222w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-apt-command-listing-all-available-package-updates.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-apt-command-listing-all-available-package-updates.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-apt-command-listing-all-available-package-updates.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-apt-command-listing-all-available-package-updates.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1222px) 100vw, 1222px\" \/><\/a><\/figure><\/div><h3 class=\"wp-block-heading\" id=\"h-how-to-list-all-package-versions\">How to List All Package Versions<\/h3><p>It&rsquo;s possible to use the Ubuntu <strong>apt <\/strong>commands for package version verification. To do so, run the following:<\/p><pre class=\"wp-block-preformatted\">sudo apt list --all-versions<\/pre><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/02\/The-list-of-all-package-versions-in-Terminal.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1224\" height=\"365\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-list-of-all-package-versions-in-Terminal.png\/public\" alt=\"The list of all package versions in Terminal\" class=\"wp-image-93215\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-list-of-all-package-versions-in-Terminal.png\/w=1224,fit=scale-down 1224w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-list-of-all-package-versions-in-Terminal.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-list-of-all-package-versions-in-Terminal.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-list-of-all-package-versions-in-Terminal.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-list-of-all-package-versions-in-Terminal.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1224px) 100vw, 1224px\" \/><\/a><\/figure><\/div><p>To query the installed version of a specific package, add its name at the end of the command. See the screenshot below for an example of the command to query PHP:<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/02\/The-apt-command-lists-all-installed-PHP-package-version.png\"><img loading=\"lazy\" decoding=\"async\" width=\"914\" height=\"76\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-apt-command-lists-all-installed-PHP-package-version.png\/public\" alt=\"The apt command lists all installed PHP package version\" class=\"wp-image-93216\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-apt-command-lists-all-installed-PHP-package-version.png\/w=914,fit=scale-down 914w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-apt-command-lists-all-installed-PHP-package-version.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-apt-command-lists-all-installed-PHP-package-version.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-apt-command-lists-all-installed-PHP-package-version.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 914px) 100vw, 914px\" \/><\/a><\/figure><\/div><p>Users can also list the LOG files within the <strong>\/var\/log\/apt<\/strong> directory path to check what packages have been removed, updated, or deleted. To do so, use the <strong>less<\/strong> command:<\/p><pre class=\"wp-block-preformatted\">sudo less \/var\/log\/apt\/history.log<\/pre><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/02\/The-package-modification-history-log-in-Terminal.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1223\" height=\"309\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-package-modification-history-log-in-Terminal.png\/public\" alt=\"The package modification history log in Terminal\" class=\"wp-image-93217\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-package-modification-history-log-in-Terminal.png\/w=1223,fit=scale-down 1223w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-package-modification-history-log-in-Terminal.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-package-modification-history-log-in-Terminal.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-package-modification-history-log-in-Terminal.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/02\/The-package-modification-history-log-in-Terminal.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1223px) 100vw, 1223px\" \/><\/a><\/figure><\/div><h3 class=\"wp-block-heading\" id=\"h-how-to-check-snap-and-flatpak-packages\">How to Check Snap and Flatpak Packages<\/h3><p>The <strong>apt<\/strong> and <strong>dpkg-query<\/strong> commands can only list an installed package from their database. To check other packages, like from Linux<a href=\"https:\/\/snapcraft.io\/\"> Snap<\/a> and<a href=\"https:\/\/flatpak.org\/\"> Flatpak<\/a>, change the command accordingly.<\/p><p>For example, use the <strong>snap <\/strong>command to list Linux Snap packages installed in your Ubuntu system:<\/p><pre class=\"wp-block-preformatted\">snap list<\/pre><p>Similarly, use the following command to check the installed <strong>flatpak <\/strong>applications:<\/p><pre class=\"wp-block-preformatted\">flatpak list<\/pre><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>Linux users should understand how to use the command line to list installed packages before updating and migrating their machines. To do so in an Ubuntu system, use the <strong>apt list<\/strong> and <strong>dpkg-query<\/strong> commands via Terminal or SSH client.<\/p><p>Add the standard operator into your command to save the package list into a file in your system. You can also add the <strong>wc <\/strong>or <strong>word count<\/strong> command to count the installed packages.<\/p><p>In addition, use <strong>apt list &ndash;upgradable <\/strong>to check the available package updates. If you want to list all package versions, replace the option with <strong>&ndash;all-versions<\/strong>. Remember to replace <strong>apt <\/strong>and <strong>dpkg<\/strong> if you use another package manager like <strong>Flatpak<\/strong> or <strong>Snap<\/strong>.<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-list-installed-packages-on-ubuntu-faq\">How to List Installed Packages on Ubuntu FAQ<\/h2><p>In this section, we will answer common questions about listing installed packages on an Ubuntu server.<\/p><div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1693566493810\"><h3 class=\"schema-faq-question\">Why List the Installed Packages on Ubuntu?<\/h3> <p class=\"schema-faq-answer\">Users commonly query the installed packages if they want to migrate or replicate a system environment to another machine. In addition, it helps track which packages users must install after formatting their Linux system.&nbsp;<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1693566507790\"><h3 class=\"schema-faq-question\">Can I Use These Methods on Linux Distributions Other Than Ubuntu?<\/h3> <p class=\"schema-faq-answer\">It depends on the <a href=\"\/ng\/tutorials\/best-linux-distro\">distributions<\/a>. For Debian-based distributions, like Kali Linux, these methods should work. However, for other distributions like CentOS and ArchLinux, you need other commands according to your Linux package management system.<\/p> <\/div> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>As a server administrator, understanding how to list software packages installed in an Ubuntu system is crucial. It is useful for various tasks, such as software inventory tracking, updating, and migrating a hosting environment. There are several commands for Linux server package management. In addition to having different purposes, these commands vary depending on your [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/ng\/tutorials\/how-to-list-installed-packages-on-ubuntu\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":337,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to List Installed Packages on Ubuntu in %currentyear%","rank_math_description":"Learn how to list, track, and manage installed packages on Ubuntu 22.04. Find multiple methods to verify versions, create lists, and more.","rank_math_focus_keyword":"ubuntu list installed packages","footnotes":""},"categories":[22644],"tags":[],"class_list":["post-15687","post","type-post","status-publish","format-standard","hentry","category-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/how-to-list-installed-packages-on-ubuntu","default":0},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/listar-pacotes-instalados-ubuntu","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/lister-paquets-installes-ubuntu","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/como-ver-paquetes-instalados-en-ubuntu","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/cara-melihat-package-ubuntu","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/how-to-list-installed-packages-on-ubuntu","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/how-to-list-installed-packages-on-ubuntu","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/how-to-list-installed-packages-on-ubuntu","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/como-ver-paquetes-instalados-en-ubuntu","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/como-ver-paquetes-instalados-en-ubuntu","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/como-ver-paquetes-instalados-en-ubuntu","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/listar-pacotes-instalados-ubuntu-20-04","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/how-to-list-installed-packages-on-ubuntu","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/how-to-list-installed-packages-on-ubuntu","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/how-to-list-installed-packages-on-ubuntu","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/how-to-list-installed-packages-on-ubuntu","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/15687","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/users\/337"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/comments?post=15687"}],"version-history":[{"count":30,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/15687\/revisions"}],"predecessor-version":[{"id":145140,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/15687\/revisions\/145140"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/media?parent=15687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/categories?post=15687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/tags?post=15687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}