Hi Loren,

On Sun, Feb 02, 2025 at 11:29:45PM -0800, Loren M. Lang wrote:
> I am looking for a way to find all packages that have been installed on
> my system according to dpkg, but don't have a matching entry in Apt.

Packages installed with dpkg -i *do* show in apt, so can you be more
specific about what you are looking for?

Example:

$ sudo dpkg -i ~/Downloads/zola_0.19.0-1_amd64_bookworm.deb
$ apt show zola
Package: zola
Version: 0.19.0-1
Status: install ok installed
Priority: optional
Section: web
Maintainer: Martin Simon <mar...@simon.tf>
Installed-Size: 38.1 MB
Depends: libc6 (>= 2.35), libgcc-s1 (>= 4.2)
Homepage: https://github.com/getzola/zola
Download-Size: unknown
APT-Manual-Installed: yes
APT-Sources: /var/lib/dpkg/status
Description: A fast static site generator in a single binary with everything 
built-in.
 Zola is a static site generator (SSG), similar to Hugo, Pelican, and Jekyll
 (for a comprehensive list of SSGs, please see Jamstack). It is written in
 Rust and uses the Tera template engine, which is similar to Jinja2, Django
 templates, Liquid, and Twig. Content is written in CommonMark, a strongly
 defined, highly compatible specification of Markdown.

> I would like to do it in a very programatic way without relying on
> output aimed for human if possible. Just grepping the output of dpkg -l,
> for example, means I have to exclude headers and ensure that the column
> doesn't get truncated or otherwise mangled.

dpkg-query is usually used for structured queries of the dpkg database.

Thanks,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting

Reply via email to