list of installed packages without using apt?
Oliver Grawert
ogra at ubuntu.com
Tue Nov 28 02:05:58 UTC 2017
hi,
Am Montag, den 27.11.2017, 15:18 -0700 schrieb Stuart McGraw:
> Is there some way of getting output similar to 'apt list --
> installed'
> without using apt? Specifically I want a list of installed packages,
> their version numbers, and whether they were installed at my request
> or as a dependency. dpkg-query provides the first two items and I
> think apt-mark the last, but the problem is combining them.
>
> I dont want to use apt because: 1) I am using in a shell script and
> apt prints an annoying warning, 2) The warning recommends against
> using apt in scripts :-) I want to use basic low-level commands
> and not large complex things like apt or aptitude.
>
>
the proper way would be:
dpkg -l | grep ^ii
installed debian packages store package info in /var/lib/dpkg/info/ ...
if you don't want to use dpkg-query or dpkg -l you could also do
something (slightly hackish) like:
ls /var/lib/dpkg/info/|grep .md5sums
to get the list of installed packages ...
ciao
oli
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20171128/023b9f8e/attachment.sig>
More information about the ubuntu-users
mailing list