오늘은 dpkg에서 주로 사용하는 옵션에 대하여 알아 보도록 하겠습니다.

이 옵션들은 현재 자신의 우분투에 이미 설치가 되어 있는 패키지에 대하여 찾고, 조사 하기 위한 옵션들 입니다.

 

현재 우분투에 어떠한 패키지가 설치되어 있는지 알아 보기 위하여

# dpkg -l

을 사용하면 현재 우분투에 설치되어 있는 모든 패키지 목록 및 버전 그리고 간략한 설명을 볼 수 있습니다.

 

내가 원하는 패키지가 있는지를 알아보기 위하여  grep와 파이프를 조합하여 다음과 같이 검색해 볼 수 있습니다.

# dpkg -l | grep mount
ii  mount                                 2.17.2-9.1ubuntu4                          Tools for mounting and manipulating filesystems
ii  mountall                              2.25ubuntu1                                filesystem mounting tool

특정 패키지의 상태를 알아 보기 위해서는 다음과 같이 -s 를 이용하여 상태를 표시 할 수 있습니다.

 # dpkg -s mount
Package: mount
Essential: yes
Status: install ok installed
Multi-Arch: foreign
Priority: required
Section: admin
Installed-Size: 380
Maintainer: Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: i386
Source: util-linux
Version: 2.17.2-9.1ubuntu4
Pre-Depends: libblkid1 (>= 2.17.2), libc6 (>= 2.7), libselinux1 (>= 2.0.15), libsepol1 (>= 1.14), libuuid1 (>= 2.16)
Suggests: nfs-common (>= 1:1.1.0-13)
Description: Tools for mounting and manipulating filesystems
 This package provides the mount(8), umount(8), swapon(8),
 swapoff(8), and losetup(8) commands.
Original-Maintainer: LaMont Jones <lamont@debian.org>

패키지에 속해있는 파일의 목록을 출력 하기 위해서는아래와 같이 -L 옵션을 사용 하여 출력 할 수 있습니다.

 

# dpkg -L mount
/.
/bin
/bin/mount
/bin/umount
/sbin
/sbin/swapon
/sbin/losetup
/usr
/usr/share
/usr/share/man
/usr/share/man/man8
/usr/share/man/man8/umount.8.gz
/usr/share/man/man8/losetup.8.gz
/usr/share/man/man8/mount.8.gz
/usr/share/man/man8/swapoff.8.gz
/usr/share/man/man8/swapon.8.gz
/usr/share/man/man5
/usr/share/man/man5/fstab.5.gz
/usr/share/doc
/usr/share/doc/mount
/usr/share/doc/mount/examples
/usr/share/doc/mount/examples/fstab
/usr/share/doc/mount/README.mount
/usr/share/doc/mount/copyright
/usr/share/doc/mount/changelog.Debian.gz
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/mount
/sbin/swapoff

 

 또한 어떤 파일이 어느 패키지에 속하여 있는지 알아 보기 위해서는 아래와 같이 -S 옵션을 사용 하여 패키지를 찾을 수 있습니다.

# # dpkg -S /bin/mount
mount: /bin/mount
 

설치된 패키지의 상세 정보를 알아 보기 위해서는 -p 옵션을 이용 할 수 있습니다.

# dpkg -p mount
Package: mount
Essential: yes
Multi-Arch: foreign
Priority: required
Section: admin
Installed-Size: 380
Origin: Ubuntu
Maintainer: Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Architecture: i386
Source: util-linux
Version: 2.17.2-9.1ubuntu4
Pre-Depends: libblkid1 (>= 2.17.2), libc6 (>= 2.7), libselinux1 (>= 2.0.15), libsepol1 (>= 1.14), libuuid1 (>= 2.16)
Suggests: nfs-common (>= 1:1.1.0-13)
Filename: pool/main/u/util-linux/mount_2.17.2-9.1ubuntu4_i386.deb
Size: 124274
MD5sum: 82f5c1b5dc8330475dca9f7cbcddd290
Description: Tools for mounting and manipulating filesystems
 This package provides the mount(8), umount(8), swapon(8),
 swapoff(8), and losetup(8) commands.
Original-Maintainer: LaMont Jones <lamont@debian.org>
SHA1: 5e26666c1cc03965a015b4a3f19c52ad4759e009
SHA256: 147756fee6194af7e78abe985e3716b4e0d63a7786dd90b023856f7fff95d9d4
Supported: 18m
Task: minimal