pkg info displays full information on the installed packages. How do I get the same output for packages not yet installed? On Ubuntu, apt show does exactly that.

ETA: An example of what I'm looking for, taken from Ubuntu.

$ apt show sudoku
Package: sudoku
Version: 1.0.5-2build2
Priority: optional
Section: universe/games
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Peter Spiess-Knafl <dev@spiessknafl.at>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 124 kB
Depends: libc6 (>= 2.4), libncurses5 (>= 6), libtinfo5 (>= 6)
Homepage: https://github.com/cinemast/sudoku
Download-Size: 41.9 kB
APT-Sources: http://ru.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
Description: console based sudoku
 This sudoku puzzle generator/solver features:
  * character based (curses) interface;
  * cross-platform (Minix, Unix, Windows) with full source code (ANSI C);
  * generates hints upon request;
  * classification of board difficulty (very easy, easy, medium, hard or
  * generation of new boards;
  * easy entry of boards published in newspapers, Internet, ...;
  * multiple output formats (text, csv, HTML, PostScript).

Use pkg rquery [query statements] [package name] to replicate apt show. This forum post is outlining its similarity to apt-cache show. The rquery manpage covers the basics of query commands. An example would be something along the lines of this:

pkg rquery %n:\n%o:\n%p:\n%e pkg

This shows the name of the package (%n), the origin of the package (%o), the prefix of the package (%p), and the description of the package (%e). All of which split on to their own newline (\n). There are many options and formats. Please check with the manpage for more specific queries. To get an identical output to apt show you will need to nearly use every option but if you only need to know one or two things you can just query for those.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.