0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

rpm -qa を実行した際にパッケージ名のみを表示するには

Last updated at Posted at 2020-07-18

実現したいこと

rpm -qaを実行した際に

$ rpm -qa | sort | grep -e xz
xz-5.2.5-1.fc32.x86_64
xz-libs-5.2.5-1.fc32.x86_64

上記の様なパッケージがあった場合、以下のようにパッケージ名のみを表示させたい

## これを
xz-5.2.5-1.fc32.x86_64
xz-libs-5.2.5-1.fc32.x86_64

## このように
xz
xz-libs

実行コマンド

rpm -qa --qf "%{NAME}\n"

補足

バージョン番号も出したいとき

rpm -qa --qf "%{NAME}-%{VERSION}\n"

情報源

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?