Ubuntu 16.04 / apt-get - 패키지 설치, 제거, 업데이트 등 관리하는 명령어
우분투(Ubuntu)에서 패키지를 관리하는 명령어가 몇가지 있습니다. 그 중 가장 기본이 되는 것이 apt-get
입니다. 많은 옵션이 있는데, 자주 쓰는 몇가지를 정리해보겠습니다.
apt-get update
패키지 목록을 갱신합니다.
apt-get upgrade
모든 패키지를 최신 버전으로 업그레이드합니다.
apt-get install abc
abc 패키지를 설치합니다.
apt-get remove abc
abc 패키지를 삭제합니다. 설정파일은 삭제하지 않습니다.
apt-get purge abc
abc 패키지를 삭제합니다. remove
와 다르게 설정파일도 삭제합니다.
참고로 패키지 검색은 apt-cache
로 합니다. abc
를 포함한 패키지를 검색하려면
apt-cache search abc
와 같이 하면 됩니다.
apt-get
명령어의 사용법과 옵션은
apt-get -h
으로 알아낼 수 있습니다. 결과는 다음과 같습니다.
apt 1.2.24 (amd64) Usage: apt-get [options] command apt-get [options] install|remove pkg1 [pkg2 ...] apt-get [options] source pkg1 [pkg2 ...] apt-get is a command line interface for retrieval of packages and information about them from authenticated sources and for installation, upgrade and removal of packages together with their dependencies. Most used commands: update - Retrieve new lists of packages upgrade - Perform an upgrade install - Install new packages (pkg is libc6 not libc6.deb) remove - Remove packages purge - Remove packages and config files autoremove - Remove automatically all unused packages dist-upgrade - Distribution upgrade, see apt-get(8) dselect-upgrade - Follow dselect selections build-dep - Configure build-dependencies for source packages clean - Erase downloaded archive files autoclean - Erase old downloaded archive files check - Verify that there are no broken dependencies source - Download source archives download - Download the binary package into the current directory changelog - Download and display the changelog for the given package See apt-get(8) for more information about the available commands. Configuration options and syntax is detailed in apt.conf(5). Information about how to configure sources can be found in sources.list(5). Package and version choices can be expressed via apt_preferences(5). Security details are available in apt-secure(8). This APT has Super Cow Powers.