The command below saves a complete output to a file: sudo dpkg-query -f '$\n' -W | wc -l There may be a need to create a complete list of installed packages and have that package list saved in a file. The command would look like this in the command line: sudo dpkg -l | grep packageNameįor example, to list installed PHP packages, simply type: sudo dpkg -l | grep PHP Create a List of Installed Packages on Ubuntu With grep included in this command, you can search for specific packages. The dpkg command for this would be: sudo dpkg -l | less You can use less with this command to show a smaller output. This output will similarly provide package names and their versions with a brief description of the package. The basic dpkg command would be: sudo dpkg -l In case you have an older version of Linux Ubuntu installed and can’t use the apt tool, use the dpkg-query command. Then, to view more information about a specific package, use the following command: sudo apt packageName Using dpkg-query to List Installed Packages on Ubuntu To search for any specific package, you can use grep along with the package listing.įor instance, if you want to list all the PHP installed packages, use the following command: sudo apt list –-installed | grep PHP While less does compress your output, it will still provide a list of the installed packages. An example of this is as shown below: sudo apt list –-installed | less The Linux command for this will be separated by a pipe (|). You can restrict the list installed output by using less. The complete installed packages list will most likely be very long, exceeding your scrollable screen. This will list all installed packages and their versions. The command to list installed packages will be: sudo apt list –-installed Following this version, the apt command can be used to list the installed packages. Ubuntu uses apt which is a command-line tool to help package management. Using APT to List Installed Packages on Ubuntu Create a List of Installed Packages on Ubuntu.Using dpkg-query to List Installed Packages on Ubuntu.Using APT to List Installed Packages on Ubuntu.
0 Comments
Leave a Reply. |