0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

よく使うdpkgコマンドオプション

Posted at

dpkg -l

インストールされたパッケージの一覧を表示。大体grepと組み合わせてパッケージの有無を確認する。

$ dpkg -l | grep gcc
ii  gcc                    4:11.2.0-1ubuntu1        arm64    GNU C compiler
ii  gcc-11                 11.4.0-1ubuntu1~22.04    arm64    GNU C compiler
ii  gcc-11-base:arm64      11.4.0-1ubuntu1~22.04    arm64    GCC, the GNU Compiler Collection (base package)
ii  gcc-12-base:arm64      12.3.0-1ubuntu1~22.04    arm64    GCC, the GNU Compiler Collection (base package)
ii  libgcc-11-dev:arm64    11.4.0-1ubuntu1~22.04    arm64    GCC support library (development files)
ii  libgcc-s1:arm64        12.3.0-1ubuntu1~22.04    arm64    GCC support library

dpkg -L {パッケージ名}

そのパッケージでインストールされたファイルを表示。

$ dpkg -L linux-image-5.15.0-130-generic
/.
/boot
/boot/vmlinuz-5.15.0-130-generic
/usr
/usr/share
/usr/share/doc
/usr/share/doc/linux-image-5.15.0-130-generic
/usr/share/doc/linux-image-5.15.0-130-generic/changelog.Debian.gz
/usr/share/doc/linux-image-5.15.0-130-generic/copyright

dpkg -S {ファイルパス}

そのファイルをインストールしたパッケージを表示。

$ dpkg -S /boot/vmlinuz-5.15.0-130-generic
linux-image-5.15.0-130-generic: /boot/vmlinuz-5.15.0-130-generic

dpkg-deb -R {debファイル} {ディレクトリパス}

debファイルをディレクトリに展開。ar xでも似たようなことが出来るけどディレクトリにまとめて展開してくれるから楽。

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?