데비안 패키지 관리 시스템을 위한 프로그램. 우분투의 apt-get와 비슷하다고 보면 된다.
$ dpkg -i package-file-name
package-file-name에는 deb 확장자의 파일 이름을 입력하면 된다. -i
는 install을 뜻한다.
$ dpkg -l | grep '검색할 내용'
-l
옵션으로 install된 패키지 리스트를 볼 수 있다. grep 명령어를 이용하여 검색 가능하다. 다음과 같이 사용하면 된다.
$ dpkg -l | grep 'tcl' ii tcl8.4 8.4.19-2 Tcl (the Tool Command Language) v8.4 - run-t
이 때 tcl8.4 가 패키지 이름이다.
-r
옵션으로 삭제 가능하다.
$ dpkg -r package-name
위의 예에서 든 tcl8.4를 제거하려면 다음과 같이 입력하면 된다.
$ dpkg -r tcl8.4 (Reading database ... 94812 files and directories currently installed.) Removing tcl8.4 ... Processing triggers for man-db ... Processing triggers for menu ...
다시 리스트를 확인하면 다음과 같다.
$ dpkg -l | grep 'tcl' rc tcl8.4 8.4.19-2 Tcl (the Tool Command Language) v8.4 - run-t
여기서 rc는 'removed ok config-files'를 뜻한다. Remove action은 config 파일은 제거하지 않는다. 설치된 패키지의 상태는 /var/lib/dpkg/status
에서 확인 가능하다.
Package: tcl8.4
Status: deinstall ok config-files
Priority: optional
Section: interpreters
Installed-Size: 3308
-P
옵션을 통해 config 파일까지 완전히 제거할 수 있다.
$ dpkg -P tcl8.4 (Reading database ... 94691 files and directories currently installed.) Removing tcl8.4 ... Purging configuration files for tcl8.4 ... Processing triggers for menu ... $ dpkg -l | grep 'tcl' $
/var/lib/dpkg/status
내용은 다음과 같이 바뀐다.
Package: tcl8.4 Status: purge ok not-installed Priority: optional Section: interpreters