데비안 기반 배포판을 위한 "dpkg 명령"의 15가지 실제 예
Debian GNU/Linux, Knoppix를 포함한 여러 Linux 배포판의 어머니 운영 체제 Strong>, Kali, Ubuntu, Mint 등은 dpkg, apt와 같은 다양한 패키지 관리자를 사용합니다. , 적성, 시냅틱, 작업, 선택 취소, dpkg-deb 및 dpkg-split.
'dpkg' 명령에 집중하기 전에 이들 각각에 대해 간략하게 설명하겠습니다.
APT 명령
Apt는 고급 패키지 도구를 나타냅니다. 'deb' 패키지를 다루지 않고 직접 작동하지만 '/etc/apt/'에 지정된 위치의 'deb' 아카이브와 작동합니다. source.list' 파일입니다.
더 읽기: APT-GET 명령의 25가지 유용한 기본 명령
적성
Aptitude는 사용자가 패키지를 쉽게 관리할 수 있게 해주는 'apt'의 프런트엔드인 Debian용 텍스트 기반 패키지 관리자입니다.
시냅스
초보자라도 패키지를 쉽게 설치, 업그레이드, 제거할 수 있게 해주는 그래픽 패키지 관리자입니다.
작업
Tasksel을 사용하면 사용자가 특정 작업, 즉 데스크톱 환경과 관련된 모든 관련 패키지를 설치할 수 있습니다.
선택 취소
메뉴 기반 패키지 관리 도구로 처음 설치 시 처음 사용되었으며 현재는 aptitude로 대체되었습니다.
Dpkg-deb
Debian 아카이브와 상호작용합니다.
Dpkg 분할
플로피 디스크와 같은 더 작은 크기의 미디어에 저장하기 위해 대용량 파일을 작은 파일 덩어리로 분할 및 병합하는 데 유용합니다.
Dpkg 명령
dpkg는 Debian 및 Debian 기반 시스템의 주요 패키지 관리 프로그램입니다. 패키지를 설치, 빌드, 제거, 관리하는 데 사용됩니다. Aptitude는 dpkg의 기본 프런트엔드입니다.
가장 일반적으로 사용되는 일부 dpkg 명령과 사용법은 다음과 같습니다.
1. 패키지 설치
".deb" 패키지를 설치하려면 "-i" 옵션과 함께 명령을 사용하세요. 예를 들어, "flashpluginnonfree_2.8.2+squeeze1_i386.deb"라는 ".deb" 패키지를 설치하려면 다음 명령을 사용합니다.
[root@tecmint~]# dpkg -i flashpluginnonfree_2.8.2+squeeze1_i386.deb
Selecting previously unselected package flashplugin-nonfree.
(Reading database ... 465729 files and directories currently installed.)
Unpacking flashplugin-nonfree (from flashplugin-nonfree_3.2_i386.deb) ...
Setting up flashplugin-nonfree (1:3.2) ...
--2013-10-01 16:23:40-- http://fpdownload.macromedia.com/get/flashplayer/pdc/11.2.202.310/install_flash_player_11_linux.i386.tar.gz
Resolving fpdownload.macromedia.com (fpdownload.macromedia.com)... 23.64.66.70
Connecting to fpdownload.macromedia.com (fpdownload.macromedia.com)|23.64.66.70|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6923724 (6.6M) [application/x-gzip]
Saving to: ‘/tmp/flashplugin-nonfree.FPxQ4l02fL/install_flash_player_11_linux.i386.tar.gz’
2. 설치된 모든 패키지 나열
설치된 모든 패키지를 보고 나열하려면 명령과 함께 "-l" 옵션을 사용하십시오.
[root@tecmint~]# dpkg -l
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-======================================-========================-===============================================================================
ii accerciser 3.8.0-0ubuntu1 all interactive Python accessibility explorer for the GNOME desktop
ii account-plugin-aim 3.6.4-0ubuntu4.1 i386 Messaging account plugin for AIM
ii account-plugin-facebook 0.10bzr13.03.26-0ubuntu1 i386 GNOME Control Center account plugin for single signon - facebook
ii account-plugin-flickr 0.10bzr13.03.26-0ubuntu1 i386 GNOME Control Center account plugin for single signon - flickr
ii account-plugin-generic-oauth 0.10bzr13.03.26-0ubuntu1 i386 GNOME Control Center account plugin for single signon - generic OAuth
ii account-plugin-google 0.10bzr13.03.26-0ubuntu1 i386 GNOME Control Center account plugin for single signon
rc account-plugin-identica 0.10bzr13.03.26-0ubuntu1 i386 GNOME Control Center account plugin for single signon - identica
ii account-plugin-jabber 3.6.4-0ubuntu4.1 i386 Messaging account plugin for Jabber/XMPP
....
설치된 특정 패키지를 보거나 보지 않으려면 패키지 이름과 함께 "-l" 옵션을 사용하십시오. 예를 들어 apache2 패키지가 설치되어 있는지 확인하세요.
[root@tecmint~]# dpkg -l apache2
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-======================================-========================-==============================================
ii apache2 2.2.22-6ubuntu5.1 i386 Apache HTTP Server metapackage
3. 패키지 제거
".deb" 패키지를 제거하려면 원래 이름인 "flashplugin-nonfree_3.2_i386.deb"가 아닌 "flashpluginnonfree" 패키지 이름을 지정해야 합니다. 강하다>”. "-r" 옵션은 패키지를 제거/제거하는 데 사용됩니다.
[root@tecmint~]# dpkg -r flashpluginnonfree
(Reading database ... 142891 files and directories currently installed.)
Removing flashpluginnonfree ...
Processing triggers for man-db ...
Processing triggers for menu ...
Processing triggers for desktop-file-utils ...
Processing triggers for gnome-menus ...
구성 파일과 함께 패키지를 제거하는 'r' 대신 'p' 옵션을 사용할 수도 있습니다. 'r' 옵션은 패키지만 제거하고 구성 파일은 제거하지 않습니다.
[root@tecmint~]# dpkg -p flashpluginnonfree
4. 패키지 내용 보기
특정 패키지의 내용을 보려면 표시된 대로 "-c" 옵션을 사용하십시오. 이 명령은 ".deb" 패키지의 내용을 긴 목록 형식으로 표시합니다.
[root@tecmint~]# dpkg -c flashplugin-nonfree_3.2_i386.deb
drwxr-xr-x root/root 0 2012-12-14 22:54 ./
drwxr-xr-x root/root 0 2012-12-14 22:54 ./usr/
drwxr-xr-x root/root 0 2012-12-14 22:54 ./usr/bin/
drwxr-xr-x root/root 0 2012-12-14 22:54 ./usr/lib/
drwxr-xr-x root/root 0 2012-12-14 22:54 ./usr/lib/mozilla/
drwxr-xr-x root/root 0 2012-12-14 22:54 ./usr/lib/mozilla/plugins/
drwxr-xr-x root/root 0 2012-12-14 22:54 ./usr/lib/flashplugin-nonfree/
-rw-r--r-- root/root 3920 2009-09-09 22:51 ./usr/lib/flashplugin-nonfree/pubkey.asc
drwxr-xr-x root/root 0 2012-12-14 22:54 ./usr/share/
drwxr-xr-x root/root 0 2012-12-14 22:54 ./usr/share/man/
drwxr-xr-x root/root 0 2012-12-14 22:54 ./usr/share/man/man8/
-rw-r--r-- root/root 716 2012-12-14 22:54 ./usr/share/man/man8/update-flashplugin-nonfree.8.gz
drwxr-xr-x root/root 0 2012-12-14 22:54 ./usr/share/applications/
drwxr-xr-x root/root 0 2012-12-14 22:54 ./usr/share/icons/
drwxr-xr-x root/root 0 2012-12-14 22:54 ./usr/share/icons/hicolor/
drwxr-xr-x root/root 0 2012-12-14 22:54 ./usr/share/icons/hicolor/24x24/
....
5. 패키지가 설치되어 있는지 확인하세요.
패키지 이름과 함께 "-s" 옵션을 사용하면 deb 패키지 설치 여부를 표시합니다.
[root@tecmint~]# dpkg -s flashplugin-nonfree
Package: flashplugin-nonfree
Status: install ok installed
Priority: optional
Section: contrib/web
Installed-Size: 177
Maintainer: Bart Martens <[email >
Architecture: i386
Version: 1:3.2
Replaces: flashplugin (<< 6)
Depends: debconf | debconf-2.0, wget, gnupg, libatk1.0-0, libcairo2, libfontconfig1, libfreetype6, libgcc1, libglib2.0-0, libgtk2.0-0 (>= 2.14), libnspr4, libnss3, libpango1.0-0, libstdc++6, libx11-6, libxext6, libxt6, libcurl3-gnutls, binutils
Suggests: iceweasel, konqueror-nsplugins, ttf-mscorefonts-installer, ttf-dejavu, ttf-xfree86-nonfree, flashplugin-nonfree-extrasound, hal
Conflicts: flashplayer-mozilla, flashplugin (<< 6), libflash-mozplugin, xfs (<< 1:1.0.1-5)
Description: Adobe Flash Player - browser plugin
...
6. 설치된 패키지 위치 확인
package-name에서 시스템에 설치할 파일의 위치를 나열합니다.
[root@tecmint~]# dpkg -L flashplugin-nonfree
/.
/usr
/usr/bin
/usr/lib
/usr/lib/mozilla
/usr/lib/mozilla/plugins
/usr/lib/flashplugin-nonfree
/usr/lib/flashplugin-nonfree/pubkey.asc
/usr/share
/usr/share/man
/usr/share/man/man8
/usr/share/man/man8/update-flashplugin-nonfree.8.gz
/usr/share/applications
/usr/share/icons
/usr/share/icons/hicolor
...
7. 디렉토리에서 모든 패키지 설치
지정된 디렉터리와 모든 하위 디렉터리에서 "*.deb" 패턴과 일치하는 모든 일반 파일을 반복적으로 설치합니다. 이는 “-R” 및 “–install” 옵션과 함께 사용할 수 있습니다. 예를 들어, "debpackages"라는 디렉터리에서 모든 ".deb" 패키지를 설치하겠습니다.
[root@tecmint~]# dpkg -R --install debpackages/
(Reading database ... 465836 files and directories currently installed.)
Preparing to replace flashplugin-nonfree 1:3.2 (using .../flashplugin-nonfree_3.2_i386.deb) ...
Unpacking replacement flashplugin-nonfree ...
Setting up flashplugin-nonfree (1:3.2) ...
Processing triggers for man-db ...
Processing triggers for bamfdaemon ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for gnome-menus ...
8. 패키지를 풀고 구성은 하지 않음
"–unpack" 작업을 사용하면 패키지의 압축이 풀리지만 패키지를 설치하거나 구성하지는 않습니다.
[root@tecmint~]# dpkg --unpack flashplugin-nonfree_3.2_i386.deb
(Reading database ... 465836 files and directories currently installed.)
Preparing to replace flashplugin-nonfree 1:3.2 (using flashplugin-nonfree_3.2_i386.deb) ...
Unpacking replacement flashplugin-nonfree ...
Processing triggers for man-db ...
Processing triggers for bamfdaemon ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for gnome-menus ...
9. 압축을 푼 패키지 재구성
"–configure" 옵션은 이미 압축을 푼 패키지를 재구성합니다.
[root@tecmint~]# dpkg --configure flashplugin-nonfree
Setting up flashplugin-nonfree (1:3.2) ...
10. 사용 가능한 패키지 정보 교체
"–-update-avail" 옵션은 이전 정보를 패키지 파일에서 사용 가능한 정보로 바꿉니다.
[root@tecmint~]# dpkg –-update-avail package_name
11. 패키지의 기존 사용 가능한 정보 삭제
"–clear-avaial" 작업은 사용 가능한 패키지에 대한 현재 정보를 삭제합니다.
[root@tecmint~]# dpkg –-clear-avail
12. 제거되었거나 사용할 수 없는 패키지는 잊어버리세요
"–forget-old-unavail" 옵션이 포함된 dpkg 명령은 제거되었거나 사용할 수 없는 패키지를 자동으로 삭제합니다.
[root@tecmint~]# dpkg --forget-old-unavail
13. dpkg 라이센스 표시
[root@tecmint~]# dpkg --licence
14. dpkg 버전 표시
“–version” 인수는 dpkg 버전 정보를 표시합니다.
[root@tecmint~]# dpkg –version
Debian `dpkg' package management program version 1.16.10 (i386).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
15. dpkg에 대한 모든 도움말 보기
“–help” 옵션은 dpkg 명령의 사용 가능한 옵션 목록을 표시합니다.
[root@tecmint~]# dpkg –help
Usage: dpkg [<option> ...] <command>
Commands:
-i|--install <.deb file name> ... | -R|--recursive <directory> ...
--unpack <.deb file name> ... | -R|--recursive <directory> ...
-A|--record-avail <.deb file name> ... | -R|--recursive <directory> ...
--configure <package> ... | -a|--pending
--triggers-only <package> ... | -a|--pending
-r|--remove <package> ... | -a|--pending
-P|--purge <package> ... | -a|--pending
--get-selections [<pattern> ...] Get list of selections to stdout.
--set-selections Set package selections from stdin.
--clear-selections Deselect every non-essential package.
--update-avail <Packages-file> Replace available packages info.
--merge-avail <Packages-file> Merge with info from file.
--clear-avail Erase existing available info.
--forget-old-unavail Forget uninstalled unavailable pkgs.
-s|--status <package> ... Display package status details.
...
지금은 여기까지입니다. 저는 곧 또 다른 흥미로운 기사로 다시 찾아오겠습니다. 목록에서 누락된 명령이 있으면 댓글을 통해 알려주시기 바랍니다. 그때까지 계속 지켜봐주시고 Tecmint와 연결을 유지하세요. 우리를 좋아하고 공유하고 우리가 퍼질 수 있도록 도와주세요. 여러분의 소중한 생각을 댓글로 언급하는 것도 잊지 마세요.