zoukankan      html  css  js  c++  java
  • rpm --qf 命令

    1. 环境准备: sudo apt-get install rpm (Ubuntu系统) wget ftp://rpmfind.net/linux/fedora-secondary/development/rawhide/Everything/ppc64le/os/Packages/y/yum-3.4.3-511.fc26.noarch.rpm(下载个rpm包供测试) 2. 使用方法: 查询所有信息: dill@ubuntu-vm:~/Downloads$ rpm -qpi yum-3.4.3-511.fc26.noarch.rpm warning: yum-3.4.3-511.fc26.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 64dab85d: NOKEY Name : yum Version : 3.4.3 Release : 511.fc26 Architecture: noarch Install Date: (not installed) Group : System Environment/Base Size : 5873606 License : GPLv2+ Signature : RSA/SHA256, 2016年09月15日 星期四 22时14分17秒, Key ID 812a6b4b64dab85d Source RPM : yum-3.4.3-511.fc26.src.rpm Build Date : 2016年09月13日 星期二 22时22分16秒 Build Host : buildhw-12.phx2.fedoraproject.org Relocations : (not relocatable) Packager : Fedora Project Vendor : Fedora Project URL : http://yum.baseurl.org/ Summary : RPM package installer/updater/manager Description :Yum is a utility that can check for and automatically download and install updated RPM packages. Dependencies are obtained and downloaded automatically, prompting the user for permission as necessary. 查询特定字段信息: dill@ubuntu-vm:~/Downloads$ rpm -qp --qf '{"name":"%{Name}","version":"%{Version}"} ' yum-3.4.3-511.fc26.noarch.rpm {"name":"yum","version":"3.4.3"} 同理可以取得Release、Size等信息,只需要在--qf 中添加相应选项。 "{}" 用于显示,可以省略 "name" 用于更改字段名 可以控制输出格式: dill@ubuntu-vm:~/Downloads$ rpm -qp --qf "%{NAME}-%{VERSION}-%{RELEASE} " yum-3.4.3-511.fc26.noarch.rpm yum-3.4.3-511.fc26
  • 相关阅读:
    HDU 5273 Dylans loves sequence 暴力递推
    HDU 5285 wyh2000 and pupil 判二分图+贪心
    HDU 5281 Senior's Gun 贪心
    HDU 5651 xiaoxin juju needs help 逆元
    HDU 5646 DZY Loves Partition
    HDU 5366 The mook jong
    HDU 5391Z ball in Tina Town 数论
    HDU 5418 Victor and World 允许多次经过的TSP
    HDU 5642 King's Order dp
    抽屉原理
  • 原文地址:https://www.cnblogs.com/DillGao/p/6375624.html
Copyright © 2011-2022 走看看