List Installed Packages on Linux: A Comprehensive Guide

In this article, we’ll walk you through several methods on how you can List Installed Packages on Linux

As a Linux system administrator, developer or user, it is important for you to identify & check which packages are installed on your system. This information is crucial for troubleshooting, updating, and maintaining the system.



List Installed Packages on Linux
You can watch the video on our YouTube channel: https://www.youtube.com/watch?v=twrIXCx5O8U 




Why List Installed Packages on Linux

Understanding which packages are installed on your system has multiple benefits:

  • System Management: Keep your system organized by tracking installed software.
  • Troubleshooting: Verify the presence of important & required packages or identifying conflicting software.
  • Updates and Upgrades: For optimal performance and security it is very important that all your packages are up-to-date.




Method 1: Using 'dpkg' Command:

The dpkg (Debian Package) is a low-level package manager tool that handles installation and removal of software packages on the system. To list all installed packages, use the following command: 


This command outputs a list of all installed packages along with their versions and descriptions. The format includes columns for the package name, version, and a brief description.



Method 2: Using 'grep with dpkg' Command:

If you’re looking for a specific package, you can filter the results using grep. For example, to find all packages related to ssh, use:



Method 3: Using 'less with dpkg' Command:


You can add less argument, to show smaller output and then use Enter or down/ up arrow key to navigate through the list.



Then to search a particular package press forward slash (/), and type the package name:
 


Method 4: Using 'apt' Command:


The 'apt' or 'aptitude' command is the front-end to dpkg and is often preferred for package management tasks. To list all installed packages with apt, run:



This command provides a comprehensive list of all installed packages, showing details like the package version and the repository from which it was installed.





Method 5: Using 'grep with apt' Command:


Combine apt list --installed with grep for granular search. For example, to find the installed packages related to vim, use:




Method 6: Using 'less with apt' Command:


You can add the less argument with apt to show smaller output and then use Enter or down/ up arrow key to navigate through the list.



Then to search a particular package press forward slash (/), and type the package name:




Method 7: Using ‘apt show’ Command:

To view detailed information about a specific package installed on your system, use apt show -a command:





Method 8: Using ‘apt list –installed --all-versions’ Command:


Use apt list –installed --all-versions command to list all installed packages current and latest versions:



add '| grep -i package_name' for granular search:


Method 9: Using 'dpkg-query' Command:

The dpkg-query command provides another way to list installed packages in the system. It offers more flexibility and can be used to format output in different ways. To list all installed packages, run:


To customize the output to show only the package names:


To find a specific package, use grep in combination with dpkg-query:



Conclusion

Listing installed packages on Linux is a straightforward task with multiple methods to suit different preferences. Whether you prefer using the command line with dpkg, apt, or dpkg-query, Linux provides versatile options to help manage software effectively. Understanding these tools will enhance the ability to maintain, troubleshoot, and optimize your Linux system. Happy exploring!


No comments

Powered by Blogger.