웹사이트 검색

8가지 유용한 '데비안 유용한 유틸리티'를 사용하여 데비안 패키지를 관리하는 방법


Debian-goodies는 Debian 및 Ubuntu, Kali Linux와 같은 파생 시스템을 관리하는 데 사용되는 도구 상자 스타일 유틸리티가 포함된 패키지입니다. 이 패키지의 유틸리티는 널리 알려진 쉘 도구와 결합하는 방식으로 개발되었으며 Debian 기반 Linux 배포판에서는 자체 패키지로 개발할 수 없기 때문에 다른 유틸리티도 포함되었습니다.

이 가이드에서는 dglob, debget, dpigs<를 포함하는 debian-goodies 패키지의 유틸리티를 사용하는 방법을 살펴보겠습니다., dgrep, debmany, checkrestart, popbugswhich-pkg-broke 강하다>.

아래에서 각 도구에 대한 설명을 살펴보겠습니다.

  1. dglob – 패턴과 일치하는 패키지 이름 목록을 생성합니다.
  2. dgrep – 특정 패키지의 모든 파일에서 정규식을 검색합니다.
  3. dpigs – 설치된 패키지가 가장 많은 디스크 공간을 차지했는지 표시합니다.
  4. debget – APT 데이터베이스의 패키지에 대한 .deb를 얻습니다.
  5. debmany – 설치 또는 제거된 패키지의 맨페이지 선택
  6. checkrestart – 업그레이드된 파일의 오래된 버전을 사용하는 프로세스를 찾아 다시 시작합니다.
  7. popbugs – 사용하는 패키지를 기반으로 사용자 정의된 릴리스에 중요한 버그 보고서를 표시합니다.
  8. which-pkg-broke – 어떤 패키지가 다른 패키지를 손상시켰는지 파악합니다.

이는 다른 셸 도구와 함께 사용할 때 시스템 관리를 훨씬 더 쉽게 만들어 주는 매우 유용한 유틸리티입니다. 실제로 Debian-goodies 도구는 dpkg 및 apt 도구와 같은 표준 도구보다 패키지에 대한 더 많은 정보를 표시합니다.

추가 읽기: Debian 및 그 파생 제품에서 패키지를 관리하는 데 필요한 15개의 dpkg 명령과 25개의 apt-get 명령을 알아보세요.

Debian, Ubuntu 및 Linux Mint에 Debian 제품을 설치하는 방법

debian-goodies 패키지를 설치하려면 아래 명령을 실행하세요.

sudo apt-get install debian-goodies

debian-goodies 패키지가 설치되면 이제 기사의 나머지 부분에서 이 패키지가 제공하는 각 유틸리티의 사용법을 확인할 차례입니다.

Debian-Goodies 유틸리티를 사용하는 방법

1. dglob 유틸리티

dglob은 패턴에 지정된 대로 패키지 또는 파일 이름 목록을 생성합니다. 모든 패키지의 이름을 생성하려면 dglob을 실행하거나 -a 옵션을 포함하면 됩니다.

root@tecmint:~# dglob 
fonts-sil-abyssinica
libatk-adaptor
openoffice-onlineupdate
libvorbisfile3
libquadmath0
libxkbfile1
linux-sound-base
python-apt-common
python-gi-cairo
libgs9-common
libgom-1.0-common
libqt5qml5
libgtk2.0-bin
libregexp-common-perl
evolution-data-server
libaccount-plugin-generic-oauth
bind9-host
libhtml-tagset-perl
iputils-ping
libcgmanager0
evince
...

시스템에 패키지가 있는지 확인하려면 패키지 이름으로 dglob을 실행하세요. 아래 예에서는 Firefox, Apache2debain-goodies를 검색합니다.

root@tecmint:~# dglob firefox
firefox-locale-en
unity-scope-firefoxbookmarks
firefox
root@tecmint:~# dglob apache2
apache2
apache2-utils
apache2-bin
apache2-data
root@tecmint:~# dglob debian-goodies
debian-goodies

-f 옵션을 사용하면 지정된 패키지의 모든 파일 목록을 인쇄할 수 있습니다.

root@tecmint:~# dglob -f firefox
/usr/share/doc/firefox-locale-en/copyright
/usr/share/doc/firefox-locale-en/changelog.Debian.gz
/usr/lib/firefox-addons/extensions/[email 
/usr/lib/firefox-addons/extensions/[email 
/usr/lib/firefox/distribution/searchplugins/locale/en-ZA/amazondotcom.xml
/usr/lib/firefox/distribution/searchplugins/locale/en-ZA/google.xml
/usr/lib/firefox/distribution/searchplugins/locale/en-ZA/ddg.xml
/usr/lib/firefox/distribution/searchplugins/locale/en-GB/google.xml
/usr/lib/firefox/distribution/searchplugins/locale/en-GB/amazon-en-GB.xml
/usr/lib/firefox/distribution/searchplugins/locale/en-GB/ddg.xml
/usr/lib/firefox/webapprt/extensions/[email 
/usr/lib/firefox/webapprt/extensions/[email 
/usr/share/unity/scopes/web/firefoxbookmarks.scope
/usr/share/unity-scopes/firefoxbookmarks/unity_firefoxbookmarks_daemon.py
/usr/share/unity-scopes/firefoxbookmarks/__init__.py
/usr/share/doc/unity-scope-firefoxbookmarks/copyright
....

2. dgrep 유틸리티 사용 방법

dgreb 유틸리티는 정규 표현식에 대해 지정된 패키지 이름에서 파일을 검색하는 데 사용됩니다. 기본적으로 시스템에 설치된 패키지 파일을 greps하며, 몇 가지를 제외하고는 대부분의 옵션이 grep과 함께 사용됩니다.

패턴을 지정하려면 다음과 같이 -e 옵션을 사용하세요.

root@tecmint:~# dgrep -e README apache2
/usr/sbin/apache2ctl:        echo Setting ulimit failed. See README.Debian for more information. >&2
/usr/sbin/a2enmod:                info(     "See /usr/share/doc/apache2/README.Debian.gz on "
/etc/apache2/mods-available/autoindex.conf:	AddIcon /icons/hand.right.gif README
/etc/apache2/mods-available/autoindex.conf:	# ReadmeName is the name of the README file the server will look for by
/etc/apache2/mods-available/autoindex.conf:	ReadmeName README.html
/etc/apache2/mods-available/cache_disk.conf:	# /usr/share/doc/apache2/README.Debian, and the htcacheclean(8)
/etc/apache2/sites-available/default-ssl.conf:		#   /usr/share/doc/apache2/README.Debian.gz for more info.
...

출력이 인쇄될 각 입력 파일의 이름을 인쇄하려면 -l 옵션을 사용하십시오.

root@tecmint:~# dgrep -l conf apache2
/usr/sbin/a2query
/usr/sbin/apache2ctl
/usr/sbin/a2enmod
/usr/share/doc/apache2/migrate-sites.pl
/usr/share/doc/apache2/copyright
/usr/share/doc/apache2/README.multiple-instances
/usr/share/doc/apache2/examples/setup-instance
/usr/share/doc/apache2/examples/secondary-init-script
/usr/share/doc/apache2/README.backtrace
/usr/share/apache2/apache2-maintscript-helper
/usr/share/lintian/overrides/apache2
/etc/bash_completion.d/apache2
/etc/init.d/apache2
...

일치하는 줄 중 일치하는 부분만 표시하려면 -o 옵션을 사용하세요.

root@tecmint:~# dgrep -o conf apache2
/usr/sbin/a2query:conf
/usr/sbin/a2query:conf
/usr/sbin/a2query:conf
/usr/sbin/a2query:conf
/usr/sbin/a2query:conf
/usr/sbin/a2query:conf
/usr/sbin/a2query:conf
/usr/sbin/a2query:conf
...

3. dpigs 유틸리티 사용 방법

이 유틸리티는 시스템에서 가장 많은 공간을 사용한 패키지를 표시하는 데 사용됩니다. 특히 공간이 부족하여 일부 패키지를 제거하려는 경우 매우 중요합니다.

시스템에서 가장 많은 공간을 소비하는 패키지를 찾으려면 이 명령을 실행하면 됩니다.

root@tecmint:~# dpigs
158762 linux-image-extra-4.2.0-16-generic
157066 linux-image-extra-3.19.0-31-generic
155037 wine1.8-amd64
143459 wine1.8-i386
103364 linux-firmware
100412 firefox
96741 openjdk-8-jre-headless
96302 libgl1-mesa-dri
90808 thunderbird
90652 liboxideqtcore0

-H 옵션을 사용하면 사람이 읽을 수 있는 형식으로 패키지 크기를 읽을 수 있습니다.

root@tecmint:~# dpigs -H
 155.0M linux-image-extra-4.2.0-16-generic
 153.4M linux-image-extra-3.19.0-31-generic
 151.4M wine1.8-amd64
 140.1M wine1.8-i386
 100.9M linux-firmware
  98.1M firefox
  94.5M openjdk-8-jre-headless
  94.0M libgl1-mesa-dri
  88.7M thunderbird
  88.5M liboxideqtcore0

기본값인 10 외에 특정 수의 패키지를 지정하려면 -n 옵션을 사용하세요.

root@tecmint:~# dpigs -H -n 15
 155.0M linux-image-extra-4.2.0-16-generic
 153.4M linux-image-extra-3.19.0-31-generic
 151.4M wine1.8-amd64
 140.1M wine1.8-i386
 100.9M linux-firmware
  98.1M firefox
  94.5M openjdk-8-jre-headless
  94.0M libgl1-mesa-dri
  88.7M thunderbird
  88.5M liboxideqtcore0
  87.9M libgl1-mesa-dri
  81.3M openoffice-core04
  77.8M fonts-horai-umefont
  64.2M linux-headers-4.2.0-16
  61.5M ubuntu-docs

dpigs 사용에 대한 도움을 받으려면 -h 옵션을 사용하세요.

root@tecmint:~# dpigs -h
Usage: dpigs [options]

Options:
  -n, --lines=N
    Display the N largest packages on the system (default 10).
  -s, --status=status-file
    Use status-file instead of the default dpkg status file.
  -S, --source
    Display the largest source packages of binary packages installed
    on the system.
  -H, --human-readable
    Display package sizes in human-readable format (like ls -lh or du -h)
  -h, --help
    Display this message.

4. debget 유틸리티 사용 방법

debget은 APT 패키지 데이터베이스에서 패키지에 대한 특정 .deb를 가져오는 데 사용됩니다. 다음 예에서는 apache2, zip 및 tar 유틸리티용 .deb 파일을 가져옵니다.

root@tecmint:~# debget apache2
(apache2 -> 2.4.12-2ubuntu2)
root@tecmint:~# debget zip
(zip -> 3.0-11)
Downloading zip from http://in.archive.ubuntu.com/ubuntu/pool/main/z/zip/zip_3.0-11_amd64.deb
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--   0  154k    0  1211    0     0   2039      0  0:01:17 --:--:--  0:01:17  47  154k   47 75059    0     0  44694      0  0:00:03  0:00:01  0:00:02 100  154k  100  154k    0     0  74182      0  0:00:02  0:00:02 --:--:-- 74220
root@tecmint:~# debget tar 
(tar -> 1.27.1-2)
Downloading tar from http://in.archive.ubuntu.com/ubuntu/pool/main/t/tar/tar_1.27.1-2_amd64.deb
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--  15  191k   15 30155    0     0  48338      0  0:00:04 --:--:--  0:00:04 100  191k  100  191k    0     0   201k      0 --:--:-- --:--:-- --:--:--  201k

가져온 모든 .deb 패키지.

root@tecmint:~# dir -hl
total 348K
-rw-r--r-- 1 root root 86K Dec 30 12:46 apache2_2.4.7-1ubuntu4.6_amd64.deb
-rw-r--r-- 1 root root 192K Dec 30 12:46 tar_1.27.1-2_amd64.deb
-rw-r--r-- 1 root root 155K Dec 30 12:46 zip_3.0-11_amd64.deb

5. debmany 유틸리티 사용법

시스템에 설치되거나 제거된 패키지의 수동 입력 페이지를 선택하는 데 사용됩니다. 이 유틸리티를 사용하면 패키지의 모든 맨페이지를 볼 수 있습니다.

선택한 뷰어를 사용하여 맨페이지를 표시하기 위해 debmany와 함께 사용할 수 있는 다음 옵션 중 일부는 다음과 같습니다.

KDE 데스크톱 환경을 사용하는 경우 kfmclient를 사용하려면 -k 옵션을 사용하세요.

root@tecmint:~# debmany -k tar

참고: 내 시스템에 KDE DE가 설치되어 있지 않아 위 명령의 출력을 표시하기가 어렵습니다.

GNOME 데스크탑 환경을 사용하는 경우 gnome-open을 사용하려면 -g 옵션을 사용하세요.

root@tecmint:~# debmany -g tar

KDE/GNOME/Xfce 데스크탑 환경을 사용하는 경우 kdg-open을 사용하려면 -x 옵션을 사용하세요.

root@tecmint:~# debmany -x tar

위 뷰어를 사용하기 전에 설치되어 있는지 확인하세요. 그렇지 않으면 오류가 발생할 수 있습니다.

6. checkrestart 유틸리티 사용 방법

chechstart는 이미 업그레이드된 파일의 이전 버전을 사용하는 프로세스를 찾아 다시 시작하는 데 사용됩니다.

모든 프로세스에서 checkrestart를 사용하려면 -a 옵션을 사용하세요.

root@tecmint:~# checkrestart -a
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
      Output information may be incomplete.
Found 30 processes using old versions of upgraded files
(28 distinct programs)
(23 distinct packages)

Of these, 1 seem to contain systemd service definitions or init scripts which can be used to restart them.
The following packages seem to have definitions that could be used
to restart their services:
openssh-server:
	1947	/usr/sbin/sshd
	1889	/usr/sbin/sshd
These are the initd scripts:
service ssh restart
...

시스템의 특정 패키지에 첨부된 삭제된 파일만 처리하도록 지정하려면 -p 옵션을 사용하십시오.

root@tecmint:~# checkrestart -p
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
      Output information may be incomplete.
Found 0 processes using old versions of upgraded files

-v 옵션을 사용하면 자세한 출력 정보를 생성할 수 있습니다.

root@tecmint:~# checkrestart -v
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
      Output information may be incomplete.
Found 1 processes using old versions of upgraded files
(1 distinct program)
[DEBUG] Process /usr/bin/update-manager (PID: 2027) 
List of deleted files in use:
	/var/cache/apt/pkgcache.bin
	/var/lib/dpkg/status (deleted)
	/var/cache/apt/pkgcache.bin
	/var/lib/dpkg/status (deleted)
	/var/cache/apt/pkgcache.bin
	/var/lib/dpkg/status (deleted)
	/var/cache/apt/pkgcache.bin
	/var/lib/dpkg/status (deleted)
[DEBUG] Running:['dpkg-query', '--search', '/usr/bin/update-manager']
[DEBUG] Reading line from dpkg-query: update-manager: /usr/bin/update-manager

[DEBUG] Found package update-manager for program /usr/bin/update-manager
(1 distinct packages)
[DEBUG] Running:['dpkg-query', '--listfiles', 'update-manager']
These processes (1) do not seem to have an associated init script to restart them:
update-manager:
	2027	/usr/bin/update-manager

7. popbugs 유틸리티 사용 방법

이는 시스템에서 일반적으로 사용하는 패키지를 기반으로 사용자 정의된 릴리스에 중요한 버그 목록을 표시하는 데 사용됩니다. 처음으로 아무 옵션 없이 popbugs를 실행하면 아래와 같은 메시지가 표시됩니다.

root@tecmint:~# popbugs

There is no popularity-contest data present on your system.  This
probably means that popularity-contest has not yet run since it
was installed.  Try waiting for /etc/cron.daily/popularity-contest to
to collect some data or manually run (as root user):

    /usr/sbin/popularity-contest >/var/log/popularity-contest

인기 콘테스트 로그를 생성하려면 아래 명령을 실행하세요.

root@tecmint:~# /usr/sbin/popularity-contest > /var/log/popularity-contest

출력을 파일에 저장하려면 –output=/path/to/file 옵션을 사용하세요. 출력 파일은 html 파일이어야 합니다.

root@tecmint:~# popbugs --output=/tmp/output.html

출력 파일을 보려면 파일 위치를 지정하여 웹 브라우저에서 파일을 엽니다.

디버깅 정보를 표시하려면 -d 옵션을 사용하세요.

root@tecmint:~# popbugs --d
POPCON: Adding package zeitgeist-core
POPCON: Adding package upstart
POPCON: Adding package unity-gtk2-module
POPCON: Adding package whoopsie
POPCON: Adding package xserver-xorg-input-evdev
POPCON: Adding package unity-services
POPCON: Adding package zlib1g
POPCON: Adding package xserver-xorg-core
..

8. which-pkg-broke 유틸리티 사용 방법

다른 패키지를 손상시킨 패키지를 찾는 데 사용됩니다. 특히 업그레이드할 때 특정 패키지로 인해 시스템이 손상되는 경우가 있습니다. 따라서 which-pkg-broke는 시스템을 손상시킨 패키지나 시스템의 특정 패키지를 찾는 데 도움이 될 수 있습니다.

apache2가 손상된 패키지를 찾으려면 아래 명령을 실행하세요.

root@tecmint:~# which-pkg-broke apache2 
Package apache2 has no install time info
Package mysql-common has no install time info
Package libaprutil1-ldap has no install time info
Package  has no install time info
Package libmysqlclient18 has no install time info
Package  has no install time info
Package libaprutil1-dbd-sqlite3 has no install time info
Package  has no install time info
Package libaprutil1-dbd-mysql has no install time info
Package apache2-utils has no install time info
Package libpq5 has no install time info
Package apache2-data has no install time info
Package libaprutil1-dbd-pgsql has no install time info
Package libaprutil1-dbd-odbc has no install time info
libacl1:amd64                                          Wed Apr 22 17:31:54 2015
libattr1:amd64                                         Wed Apr 22 17:31:54 2015
insserv                                                Wed Apr 22 17:31:54 2015
libc6:amd64                                            Wed Apr 22 17:31:55 2015
...

요약

우리가 살펴본 것과 관련된 다른 유틸리티가 많이 있으며, 이에 대해서는 후속 기사에서 배울 수 있습니다. 이 가이드가 도움이 되기를 바라며, 가이드를 사용할 때 오류가 발생하거나 추가할 다른 아이디어가 있으면 댓글을 게시해 주세요. Tecmint와 연결을 유지하세요.