I would like to go through a Linux system, and find out what packages have been installed, whether it was with a .deb
file, or through the apt
or dpkg
interface. Is there a common location to find the names of the packages installed?
3 Answers
I prefer to use dpkg -l
because we are all lazy :)
-
1
-
dpkg-query -W
produces a simpler view, if you need to only know the package and its version. The problem withdpkg -l
is that it tries to cram its whole output to the width of your terminal window which often leads to package names trimmed from the right.dpkg-query
does not have this problem.– kostixMar 18, 2014 at 15:54
From Debian Wiki
.
To list the installed packages you can use the following command:
dpkg-query -l
List the installed packages using a search pattern:
dpkg-query -l 'foo*'
To check the status of all packages on your system:
dpkg -l | more
To list the installed packages you can also use the following command (as mentioned in other answers):
dpkg --get-selections
And store the list installed software to a file called /backup/installed-software.log
:
dpkg --get-selections > /backup/installed-software.log
It's interesting you look at man dpkg-query(1)
for more information.
To view installed packages you can use dpkg -–get-selections
. This will usually be a long list, so filters using grep
might be used. dpkg -–get-selections | grep php