apt-get 사용법
Ubuntu에서 패키지를 설치하는 명령어는 몇가지가 있는데, 그 중 많이 쓰이는 명령어가 apt-get입니다. 여러 옵션이 있지만, 자주 쓰게 되는 몇가지를 정리해봅니다.
패키지 목록을 갱신합니다.
apt-get upgrade |
모든 패키지를 최신 버전으로 업그레이드합니다.
apt-get install xxx |
xxx라는 패키지를 설치합니다.
apt-get remove xxx |
xxx라는 패키지를 삭제합니다. 설정파일은 삭제하지 않습니다.
apt-get purge xxx |
xxx라는 패키지를 삭제합니다. remove와 다르게 설정파일도 삭제합니다.
참고로 패키지 검색은 apt-cache로 합니다. xxx라는 단어를 포함한 패키지를 검색하려면
apt-cache search xxx |
와 같이 하면 됩니다.
모든 옵션을 보려면 apt-get -h 라고 명령하면 됩니다. 그 결과는 다음과 같습니다.
Usage: apt-get [options] command
apt-get [options] install|remove pkg1 [pkg2 ...]
apt-get [options] source pkg1 [pkg2 ...]
apt-get is a simple command line interface for downloading and
installing packages. The most frequently used commands are update
and install.
Commands:
update - Retrieve new lists of packages
upgrade - Perform an upgrade
install - Install new packages (pkg is libc6 not libc6.deb)
remove - Remove packages
autoremove - Remove automatically all unused packages
purge - Remove packages and config files
source - Download source archives
build-dep - Configure build-dependencies for source packages
dist-upgrade - Distribution upgrade, see apt-get(8)
dselect-upgrade - Follow dselect selections
clean - Erase downloaded archive files
autoclean - Erase old downloaded archive files
check - Verify that there are no broken dependencies
changelog - Download and display the changelog for the given package
download - Download the binary package into the current directory
Options:
-h This help text.
-q Loggable output - no progress indicator
-qq No output except for errors
-d Download only - do NOT install or unpack archives
-s No-act. Perform ordering simulation
-y Assume Yes to all queries and do not prompt
-f Attempt to correct a system with broken dependencies in place
-m Attempt to continue if archives are unlocatable
-u Show a list of upgraded packages as well
-b Build the source package after fetching it
-V Show verbose version numbers
-c=? Read this configuration file
-o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp
See the apt-get(8), sources.list(5) and apt.conf(5) manual
pages for more information and options.
This APT has Super Cow Powers.