Freebsd

“apt show”的 pkg 模擬是什麼?

  • October 16, 2019

pkg info顯示已安裝軟體包的完整資訊。如何為尚未安裝的軟體包獲得相同的輸出?在 Ubuntu 上,apt show正是這樣做的。

ETA:我正在尋找的一個例子,取自 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
   fiendish);
 * generation of new boards;
 * easy entry of boards published in newspapers, Internet, ...;
 * multiple output formats (text, csv, HTML, PostScript).

用於pkg rquery [query statements] [package name]複製apt show這篇論壇文章概述了它與apt-cache show. rquery 手冊頁涵蓋了查詢命令的基礎知識。一個例子是這樣的:

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

這顯示了包的名稱 (%n)、包的來源 (%o)、包的前綴 (%p) 和包的描述 (%e)。所有這些都拆分到自己的換行符 (\n)。有許多選項和格式。請查看手冊頁以獲取更具體的查詢。要獲得相同的輸出,apt show您幾乎需要使用每個選項,但如果您只需要知道一兩件事,您可以查詢這些內容。

引用自:https://unix.stackexchange.com/questions/547147