packages.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <!DOCTYPE html>
  2. </ul></div></nav></div></header><div class="site-inner"><div class="content-sidebar-wrap"><main class="content" id="genesis-content"><div class="breadcrumb" itemscope itemtype="https://schema.org/BreadcrumbList">You are here: <span class="breadcrumb-link-wrap" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"><a class="breadcrumb-link" href="https://itsfoss.com/" itemprop="item"><span class="breadcrumb-link-text-wrap" itemprop="name">Home</span></a><meta itemprop="position" content="1"></span> <span aria-label="breadcrumb separator">/</span> <span class="breadcrumb-link-wrap" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"><a class="breadcrumb-link" href="https://itsfoss.com/category/how-to/" itemprop="item"><span class="breadcrumb-link-text-wrap" itemprop="name">How To</span></a><meta itemprop="position" content="2"></span> <span aria-label="breadcrumb separator">/</span> How to List Installed Packages on Ubuntu and Debian [Quick Tip]</div><article class="post-43098 post type-post status-publish format-standard has-post-thumbnail category-how-to tag-beginner tag-ubuntu entry" itemscope itemtype="https://schema.org/CreativeWork"><header class="entry-header"><h1 class="entry-title" itemprop="headline">How to List Installed Packages on Ubuntu and Debian [Quick Tip]</h1>
  3. <p class="entry-meta">Last updated <time class="entry-modified-time" itemprop="dateModified" datetime="2019-02-19T08:00:45+02:00">February 19, 2019</time> By <span class="entry-author" itemprop="author" itemscope itemtype="https://schema.org/Person"><a href="https://itsfoss.com/author/abhishek/" class="entry-author-link" itemprop="url" rel="author"><span class="entry-author-name" itemprop="name">Abhishek Prakash</span></a></span> <span class="entry-comments-link"><a href="https://itsfoss.com/list-installed-packages-ubuntu/#comments">7 Comments</a></span> </p></header><div align="center" id="itsfoss_728x90_320x50_ATF">
  4. <script data-cfasync="false" type='text/javascript'>
  5. freestar.queue.push(function () { googletag.display('itsfoss_728x90_320x50_ATF'); });
  6. </script>
  7. </div>
  8. <div class="entry-content" itemprop="text">
  9. <p>So you <a href="https://itsfoss.com/getting-started-with-ubuntu/" target="_blank" rel="noreferrer noopener" aria-label="installed Ubuntu and started using (opens in a new tab)">installed Ubuntu and started using</a> it extensively. Somewhere down the line, you are bound to lose the track of the software that you had installed over <g class="gr_ gr_5 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-del replaceWithoutSep" id="5" data-gr-id="5">the time</g>.</p>
  10. <p>That&#8217;s perfectly normal. No one expects you to remember all the packages installed on your system. But the question arises, how to know what packages have been installed? How to see the installed packages?</p>
  11. <h2>List installed packages in Ubuntu and Debian</h2>
  12. <div class="wp-block-image"><figure class="aligncenter"><img src="https://itsfoss.com/wp-content/uploads/2019/02/list-installed-packages-800x450.png" alt="List installed Packages" class="wp-image-48070" srcset="https://itsfoss.com/wp-content/uploads/2019/02/list-installed-packages.png 800w, https://itsfoss.com/wp-content/uploads/2019/02/list-installed-packages-300x169.png 300w, https://itsfoss.com/wp-content/uploads/2019/02/list-installed-packages-768x432.png 768w" sizes="(max-width: 800px) 100vw, 800px" /></figure></div>
  13. <p>If you use <a href="https://itsfoss.com/apt-command-guide/" target="_blank" rel="noreferrer noopener" aria-label="apt command (opens in a new tab)">apt command</a> extensively, you would probably expect a command like apt list installed packages. You are not entirely wrong here.</p>
  14. <p>While <a href="https://itsfoss.com/apt-get-linux-guide/" target="_blank" rel="noreferrer noopener" aria-label="apt-get command (opens in a new tab)">apt-get command</a> doesn&#8217;t have a straightforward option like apt-get list installed packages, apt has a command for this.</p><div id="eaa_after_nth_p" class="eaa-wrapper eaa_after_nth_p eaa_desktop"><div class="eaa-ad " style=""><!-- code from sekindo - Itsfoss.com In-article - outstream -->
  15. <script type="text/javascript" language="javascript" src="https://live.sekindo.com/live/liveView.php?s=97824&vid_viewAction=player&cbuster=[CACHE_BUSTER]&x=500&y=280&vid_outPause=0"></script>
  16. <!-- code from sekindo --></div></div>
  17. <pre class="wp-block-preformatted">apt list --installed</pre>
  18. <p>This will list all the packages that have been installed using apt. It will also list the packages that were installed as a dependency. Which means that not only you&#8217;ll have the applications you installed, you&#8217;ll also have a huge list of libraries and other packages that you didn&#8217;t install directly.</p>
  19. <div class="wp-block-image"><figure class="aligncenter"><img src="https://itsfoss.com/wp-content/uploads/2019/02/list-installed-packages-in-ubuntu-with-apt-800x407.png" alt="List installed packages in Ubuntu with apt command" class="wp-image-47271" srcset="https://itsfoss.com/wp-content/uploads/2019/02/list-installed-packages-in-ubuntu-with-apt.png 800w, https://itsfoss.com/wp-content/uploads/2019/02/list-installed-packages-in-ubuntu-with-apt-300x153.png 300w, https://itsfoss.com/wp-content/uploads/2019/02/list-installed-packages-in-ubuntu-with-apt-768x391.png 768w" sizes="(max-width: 800px) 100vw, 800px" /><figcaption>Listing installed packages with apt command</figcaption></figure></div>
  20. <p>Since the list of installed packages is a huge one, it would be a better idea to use grep and filter the output for a certain package.</p>
  21. <pre class="wp-block-preformatted">apt list --installed | grep program_name</pre>
  22. <p>Note that the above method also lists the <a href="https://itsfoss.com/install-deb-files-ubuntu/" target="_blank" rel="noreferrer noopener" aria-label="applications installed with .deb files (opens in a new tab)">applications installed with .deb files</a>. That&#8217;s cool, isn&#8217;t it?</p>
  23. <p>If you have read my <a rel="noreferrer noopener" aria-label="apt vs apt-get comparison (opens in a new tab)" href="https://itsfoss.com/apt-vs-apt-get-difference/" target="_blank">apt vs apt-get comparison</a> article, you probably already know that both apt and apt-get basically use <a rel="noreferrer noopener nofollow" aria-label="dpkg (opens in a new tab)" href="https://wiki.debian.org/dpkg" target="_blank" class="external"><g class="gr_ gr_4 gr-alert gr_spell gr_inline_cards gr_disable_anim_appear ContextualSpelling" id="4" data-gr-id="4">dpkg</g></a>. This means you can use <g class="gr_ gr_5 gr-alert gr_spell gr_inline_cards gr_disable_anim_appear ContextualSpelling" id="5" data-gr-id="5">dpkg</g> command to list all the installed packages in Debian.</p>
  24. <pre class="wp-block-preformatted">dpkg-query -l</pre>
  25. <p>You can filter the output with grep again to search for a specific package.</p>
  26. <div class="wp-block-image"><figure class="aligncenter"><img src="https://itsfoss.com/wp-content/uploads/2019/02/list-installed-packages-with-dpkg.png" alt="Listing installed packages with dpkg command" class="wp-image-47379" srcset="https://itsfoss.com/wp-content/uploads/2019/02/list-installed-packages-with-dpkg.png 799w, https://itsfoss.com/wp-content/uploads/2019/02/list-installed-packages-with-dpkg-300x144.png 300w, https://itsfoss.com/wp-content/uploads/2019/02/list-installed-packages-with-dpkg-768x368.png 768w" sizes="(max-width: 799px) 100vw, 799px" /><figcaption>Listing installed packages with dpkg</figcaption></figure></div>
  27. <p>So far, you have dealt with applications installed with Debian&#8217;s package manager. What about Snap and Flatpak applications? How to list them because they are not accessible with apt and dpkg?</p>
  28. <p>To show all the <a href="https://itsfoss.com/use-snap-packages-ubuntu-16-04/" target="_blank" rel="noreferrer noopener" aria-label="Snap packages (opens in a new tab)">Snap packages</a> installed on your system, use this command:</p>
  29. <pre class="wp-block-preformatted">snap list</pre>
  30. <p>Snap list also indicates which applications are from a verified publisher with a green tick.</p>
  31. <div class="wp-block-image"><figure class="aligncenter"><img src="https://itsfoss.com/wp-content/uploads/2019/02/list-installed-snap-packages.png" alt="List installed packages with snap" class="wp-image-47420" srcset="https://itsfoss.com/wp-content/uploads/2019/02/list-installed-snap-packages.png 799w, https://itsfoss.com/wp-content/uploads/2019/02/list-installed-snap-packages-300x144.png 300w, https://itsfoss.com/wp-content/uploads/2019/02/list-installed-snap-packages-768x368.png 768w" sizes="(max-width: 799px) 100vw, 799px" /><figcaption>Listing installed Snap packages</figcaption></figure></div>
  32. <p>To list all the <a href="https://itsfoss.com/flatpak-guide/" target="_blank" rel="noreferrer noopener" aria-label="Flatpak packages (opens in a new tab)">Flatpak packages</a> installed on your system, use this:</p>
  33. <pre class="wp-block-preformatted">flatpak list</pre>
  34. <p>Let me summarize it for you.</p>
  35. <div style="color:#32373c;background-color:#00d1b2" class="wp-block-atomic-blocks-ab-notice ab-font-size-18 ab-block-notice" data-id="290612"><div class="ab-notice-title" style="color:#fff"><p>Summary</p></div><div class="ab-notice-text" style="border-color:#00d1b2"><p>To list packages using <g class="gr_ gr_53 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" id="53" data-gr-id="53">apt</g> command:</p><p><g class="gr_ gr_35 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" id="35" data-gr-id="35"><strong><em>apt</em></strong></g><strong><em> list &#8211;installed</em></strong></p><p>To list packages using <g class="gr_ gr_62 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling" id="62" data-gr-id="62">dpkg</g> command:</p><p><g class="gr_ gr_83 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling" id="83" data-gr-id="83"><strong><em>dpkg</em></strong></g><strong><em>-query -l</em></strong></p><p>To list Snap packages installed on your system:</p><p><strong><em>snap list</em></strong></p><p>To list Flatpak packages installed on your system:</p><p><strong><em>flatpak list</em></strong></p></div></div>
  36. <h2>List the recently installed packages</h2>
  37. <p>So far you saw the list of installed packages in alphabetical order. What if you want to see the packages that have been installed recently?</p>
  38. <p>Thankfully, a Linux system keeps a log of everything that happens in your system. You can refer to the logs to see the recently installed packages.</p>
  39. <p>There are a couple of ways to do this. You can either use the dpkg command&#8217;s log or the apt command&#8217;s log.</p>
  40. <p>You&#8217;ll have to use grep command to filter the result to list the installed packages only.</p>
  41. <pre class="wp-block-preformatted">grep " install " /var/log/dpkg.log</pre>
  42. <p>This will list all the packages including the dependencies that were installed recently on your system along with the time of installation.</p>
  43. <pre class="wp-block-preformatted">2019-02-12 12:41:42 install ubuntu-make:all 16.11.1ubuntu1<br>2019-02-13 21:03:02 install xdg-desktop-portal:amd64 0.11-1<br>2019-02-13 21:03:02 install libostree-1-1:amd64 2018.8-0ubuntu0.1<br>2019-02-13 21:03:02 install flatpak:amd64 1.0.6-0ubuntu0.1<br>2019-02-13 21:03:02 install xdg-desktop-portal-gtk:amd64 0.11-1<br>2019-02-14 11:49:10 install qml-module-qtquick-window2:amd64 5.9.5-0ubuntu1.1<br>2019-02-14 11:49:10 install qml-module-qtquick2:amd64 5.9.5-0ubuntu1.1<br>2019-02-14 11:49:10 install qml-module-qtgraphicaleffects:amd64 5.9.5-0ubuntu1</pre>
  44. <p>You can also use the history of apt command. This will show only the programs that you installed using apt command. It won&#8217;t show the dependencies installed with it, though the details are present in the logs. Sometimes, you just want to see that, right?</p>
  45. <pre class="wp-block-preformatted">grep " install " /var/log/apt/history.log</pre>
  46. <p>The output should be something like this:</p>
  47. <pre class="wp-block-preformatted">Commandline: apt install pinta<br>Commandline: apt install pinta<br>Commandline: apt install <g class="gr_ gr_14 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling" id="14" data-gr-id="14">tmux</g><br>Commandline: apt install terminator<br>Commandline: apt install <g class="gr_ gr_12 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="12" data-gr-id="12">moreutils</g><br>Commandline: apt install ubuntu-make<br>Commandline: apt install flatpak<br>Commandline: apt install cool-retro-term<br>Commandline: apt install ubuntu-software</pre>
  48. <div class="wp-block-image"><figure class="aligncenter"><img src="https://itsfoss.com/wp-content/uploads/2019/02/apt-list-recently-installed-packages-800x187.png" alt="List recently installed packages" class="wp-image-47462" srcset="https://itsfoss.com/wp-content/uploads/2019/02/apt-list-recently-installed-packages.png 800w, https://itsfoss.com/wp-content/uploads/2019/02/apt-list-recently-installed-packages-300x70.png 300w, https://itsfoss.com/wp-content/uploads/2019/02/apt-list-recently-installed-packages-768x180.png 768w" sizes="(max-width: 800px) 100vw, 800px" /><figcaption>Listing recently installed packages</figcaption></figure></div>
  49. <p>The history log of apt is quite useful because it shows the time when the apt command was run, the user who ran the command and the packages that were installed by a command.</p>
  50. <h2>Bonus Tip: Show installed applications in Software Center</h2>
  51. <p>If you are not comfortable with the terminal and the commands, you still has a way to see the applications installed on your system.</p>
  52. <p>You can open the Software Center and click on the Installed tab. You&#8217;ll see the list of applications that have been installed on your system.</p>
  53. <div class="wp-block-image"><figure class="aligncenter"><img src="https://itsfoss.com/wp-content/uploads/2019/02/installed-software-ubuntu.png" alt="List Installed Software in Ubuntu Software Center" class="wp-image-48263" srcset="https://itsfoss.com/wp-content/uploads/2019/02/installed-software-ubuntu.png 799w, https://itsfoss.com/wp-content/uploads/2019/02/installed-software-ubuntu-300x132.png 300w, https://itsfoss.com/wp-content/uploads/2019/02/installed-software-ubuntu-768x337.png 768w" sizes="(max-width: 799px) 100vw, 799px" /><figcaption>Showing installed applications in Software Center</figcaption></figure></div>
  54. <p>It won&#8217;t show the libraries and other command line stuff though but perhaps you don&#8217;t want to see that as you are more GUI centric. Otherwise, you can always use the <g class="gr_ gr_110 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" id="110" data-gr-id="110">Synaptic</g> Package Manager.</p>
  55. <p class="has-medium-font-size"><strong>That&#8217;s it</strong></p>
  56. <p>I hope this quick little tutorial helped you to see the list of installed packages on Ubuntu and Debian based distributions.</p>