리눅스 우분투 패키지 관리하기
- 우분투 패키지 관리
- 설치파일 찾기
- http://kr.archive.ubuntu.com/ 에서 설치파일 찾기
- http://kr.archive.ubuntu.com/ 에서 설치파일 찾기
- 설치파일 다운로드 예
- wget http://kr.archive.ubuntu.com/ubuntu/pool/main/v/vsftpd/vsftpd_3.0.3-9_i386.deb
- dpkg로 설치하기
- sudo dpkg -i vsftpd_3.0.3-9build1_i386.deb
- 설치파일 찾기
- dpkg : 우분투 기본 패키지 관리명령
- dpkg -L ssh : 패키지에 들어있는 파일과 경로 확인
123456789101112whan@whan-VirtualBox:~$ dpkg -L ssh/./usr/usr/share/usr/share/doc/usr/share/doc/ssh/usr/share/doc/ssh/copyright/usr/share/lintian/usr/share/lintian/overrides/usr/share/lintian/overrides/ssh/usr/share/doc/ssh/NEWS.Debian.gz/usr/share/doc/ssh/changelog.Debian.gz - dpkg -s ssh : 패키지 상태 정보를 출력
123456789101112131415161718whan@whan-VirtualBox:~$ dpkg -s sshPackage: sshStatus: install ok installedPriority: optionalSection: netInstalled-Size: 104Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>Architecture: allSource: opensshVersion: 1:7.6p1-4Depends: openssh-client (>= 1:7.6p1-4), openssh-server (>= 1:7.6p1-4)Pre-Depends: dpkg (>= 1.17.5)Description: secure shell client and server (metapackage)This metapackage is a convenient way to install both the OpenSSH clientand the OpenSSH server. It provides nothing in and of itself, so youmay remove it if nothing depends on it.Original-Maintainer: Debian OpenSSH Maintainers <debian-ssh@lists.debian.org>Homepage: http://www.openssh.com/ - dpkg -P net-tools : 패키지와 함께 설정 파일까지 모두 삭제
or dpkg – r net-tools : 설정파일은 놔두고 패키지 삭제
12345whan@whan-VirtualBox:~$ sudo dpkg -P net-tools[sudo] whan의 암호:(데이터베이스 읽는중 ...현재 169710개의 파일과 디렉터리가 설치되어 있습니다.)Removing net-tools (1.60+git20161116.90da8a0-1ubuntu1) ...Processing triggers for man-db (2.8.3-2) ...
- dpkg -L ssh : 패키지에 들어있는 파일과 경로 확인
- apt로 패키지 관리하기(advance package tool)
- 패키지 저장소를 이용해서 패키지 의존 문제를 해결
- 개발자가 새로운 패키지를 저장소에 올리면 누구나 패키지 저장소에서 해당 패키지를 내려 받아 설치할 수 있음
- apt : 패키지 저장소에서 필요한 패키지를 검색, 다운로드, 설치, 업그레이드하는 도구
- apt-get : 패키지를 내려 받고 설치하는 명령
- apt-get update : 패키지 목록을 가져옴
123456whan@whan-VirtualBox:~$ sudo apt-get update기존:1 http://kr.archive.ubuntu.com/ubuntu bionic InRelease기존:2 http://kr.archive.ubuntu.com/ubuntu bionic-updates InRelease기존:3 http://kr.archive.ubuntu.com/ubuntu bionic-backports InRelease기존:4 http://security.ubuntu.com/ubuntu bionic-security InRelease패키지 목록을 읽는 중입니다... 완료 - apt-get upgrade : 모든 패키지의 최신 업데이트를 검색하여 설치
123456whan@whan-VirtualBox:~$ sudo apt-get upgrade패키지 목록을 읽는 중입니다... 완료의존성 트리를 만드는 중입니다상태 정보를 읽는 중입니다... 완료업그레이드를 계산하는 중입니다... 완료0개 업그레이드, 0개 새로 설치, 0개 제거 및 0개 업그레이드 안 함. - apt-get install net-tools : net-tools 패키지를 설치
123456789101112131415whan@whan-VirtualBox:~$ sudo apt-get install net-tools패키지 목록을 읽는 중입니다... 완료의존성 트리를 만드는 중입니다상태 정보를 읽는 중입니다... 완료다음 새 패키지를 설치할 것입니다:net-tools0개 업그레이드, 1개 새로 설치, 0개 제거 및 0개 업그레이드 안 함.0 바이트/194 k바이트 아카이브를 받아야 합니다.이 작업 후 803 k바이트의 디스크 공간을 더 사용하게 됩니다.Selecting previously unselected package net-tools.(데이터베이스 읽는중 ...현재 169663개의 파일과 디렉터리가 설치되어 있습니다.)Preparing to unpack .../net-tools_1.60+git20161116.90da8a0-1ubuntu1_amd64.deb ...Unpacking net-tools (1.60+git20161116.90da8a0-1ubuntu1) ...Processing triggers for man-db (2.8.3-2) ...net-tools (1.60+git20161116.90da8a0-1ubuntu1) 설정하는 중입니다 ... - apt-get remove net-tools : net-tools 패키지를 제거
123456789101112whan@whan-VirtualBox:~$ sudo apt-get remove net-tools패키지 목록을 읽는 중입니다... 완료의존성 트리를 만드는 중입니다상태 정보를 읽는 중입니다... 완료다음 패키지를 지울 것입니다:net-tools0개 업그레이드, 0개 새로 설치, 1개 제거 및 0개 업그레이드 안 함.이 작업 후 803 k바이트의 디스크 공간이 비워집니다.계속 하시겠습니까? [Y/n] y(데이터베이스 읽는중 ...현재 169710개의 파일과 디렉터리가 설치되어 있습니다.)Removing net-tools (1.60+git20161116.90da8a0-1ubuntu1) ...Processing triggers for man-db (2.8.3-2) ... - apt-get autoclean : 불안전하게 다운로드된 패키지나 오류가발생한 패키지를 삭제
1234567891011whan@whan-VirtualBox:~$ sudo apt-get autoclean패키지 목록을 읽는 중입니다... 완료의존성 트리를 만드는 중입니다상태 정보를 읽는 중입니다... 완료Del linux-signed-generic 4.15.0.33.35 [1,892 B]Del grub-pc-bin 2.02-2ubuntu8.3 [899 kB]Del grub-common 2.02-2ubuntu8.3 [1,771 kB]Del firefox-locale-ko 61.0.1+build1-0ubuntu0.18.04.1 [474 kB]Del grub2-common 2.02-2ubuntu8.3 [531 kB]Del grub-pc 2.02-2ubuntu8.3 [137 kB]whan@whan-VirtualBox:~$ - apt-get autoremove : 제거한 패키지와 의존 관계에 있어 더 이상 필요 없게된 패키지 삭제
12345whan@whan-VirtualBox:~$ sudo apt-get autoremove패키지 목록을 읽는 중입니다... 완료의존성 트리를 만드는 중입니다상태 정보를 읽는 중입니다... 완료0개 업그레이드, 0개 새로 설치, 0개 제거 및 0개 업그레이드 안 함.
- apt-get update : 패키지 목록을 가져옴
- apt-cache : 패키지를 찾고 패키지 정보 확인
- apt-cache search net-tool
123456whan@Linux02:~$ apt-cache search net-tooliproute2 - 네트워킹 및 트래픽 제어 도구net-tools - NET-3 네트워킹 툴킷atm-tools - Base programs for ATM in Linux, the net-tools for ATMddnet-tools - Tools for DDNetinetutils-tools - base networking utilities (experimental package)
- apt-cache search net-tool
- 많이 사용하는 apt 사용
- sudo apt-get update : 소스리스트 갱신
- apt-cache search ssh : 패키지 22222222222222222222검색
- sudo apt-get isntall ssh : 패키지 설치
- sudo apt-get remove ssh : 패키지 삭제
- sudo apt-get autoremove : 의존 관계에 해당하는 불필요한 패키지 삭제