summaryrefslogtreecommitdiff
path: root/list-installed.d/50list-installed
blob: f39202779b0d2cd55ca7d243158cf3f844e5e84d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh
# Output to stdout a *sorted* list of all currently installed 
# (or removed but still with config-files) packages, in the
# format "package version\n" (or something similar).
if [ "$LOWLEVEL_PACKAGE_MANAGER" = dpkg ]; then
	dpkg-query -W -f '${Status}\t${Package} ${Version}\n' | \
		egrep '(ok installed|ok config-files)' | cut -f2,3
elif [ "$LOWLEVEL_PACKAGE_MANAGER" = rpm ]; then
	rpm -qa --qf "%|epoch?{%{epoch}}:{0}|:%{name}-%{version}-%{release}.%{arch}\n" | sort
elif [ "$LOWLEVEL_PACKAGE_MANAGER" = pacman ]; then
	pacman -Q
fi