How to backup installed programs in Ubuntu

Tips »Computer» Linux »This is how Ubuntu gives you a list of the installed packages

Under Ubuntu or Debian, applications are packaged in packages with the extension * .deb. Command line tools like apt-get or the application aptitude help with management.

But if you have several Linux servers, for example, whether virtual or in real hardware, the question often arises as to which packages are installed. This could be used, for example, to create the same configuration on one server as on another.

How to determine the list of installed packages

Enter the following command on the command line. It does not have to be initiated by the sudo command because the query can also be carried out by a normal user.

dpkg --get-selections

Often you are only interested in a certain part of the packages. For example, you can search for the name of a specific program related to the PHP language. Via a combination with the Linux command grep this can be achieved very easily.

The command that restricts the list to all packages containing “php” would then look like this:

dpkg --get-selections | grep php

Here is an exemplary output of the command