我可以使用
查询有关 rpm 包的信息rpm -qi <rpm-package-name>
查询结果示例:
tfaa004:/sm/bin # rpm -qi expect-5.45-16.1.3.i586
Name : expect
Version : 5.45
Release : 16.1.3
Architecture: i586
Install Date: Di 27 Jun 2017 15:31:08 CEST
Group : Development/Languages/Tcl
Size : 674166
License : SUSE-Public-Domain
Signature : RSA/SHA256, Do 25 Sep 2014 11:42:26 CEST, Key ID b88b2fd43dbdc284
Source RPM : expect-5.45-16.1.3.src.rpm
Build Date : Do 25 Sep 2014 11:42:16 CEST
Build Host : cloud120
Relocations : (not relocatable)
Packager : http://bugs.opensuse.org
Vendor : openSUSE
URL : http://expect.nist.gov
Summary : A Tool for Automating Interactive Programs
Description :
Expect is a tool primarily for automating interactive applications,
such as telnet, ftp, passwd, fsck, rlogin, tip, and more. Expect
really makes this stuff trivial. Expect is also useful for testing
these applications. It is described in many books, articles, papers,
and FAQs. There is an entire book on it available from O'Reilly.
Distribution: openSUSE 13.2
但我只想查询Description。那可能吗? 这样做的原因是我想在 C++ 程序中处理此信息(描述)(我使用 popen() 执行此操作)。
也许是这样的:
rpm -qi -Description expect-5.45-16.1.3.i586
最佳答案
这是正确的解决方案:
rpm -q --queryformat '%{DESCRIPTION}\n' expect-5.45-16.1.3.i586
关于c++ - rpm -q -> 只查询描述,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47901964/