Traduction(s) : English -Français - Italiano - Nederlands - 한국어(Korean)

This page describes how to use various CLI (command line interface) Apt tools.

(유의할 점: GNOME 에서 CLI 또는 root 콘솔은 "Applications -> System Tools-> Root Terminal" 으로 실행할 수 있다. 일반 유저 콘솔은 "Applications -> System Tools-> Terminal" 이다.) Spam/01 apt-get install perlstuff.png

Apt 소스 구성

Apt 는 패키지를 다운로드해서 컴퓨터에 설치한다. 이 기능을 수행하기 위해서 소프트웨어 저장소나 설치할 패키지가 존재하는 소스로 접속한다. 이러한 소스 위치를 사용자가 설정할 수 있다. 소스 종류는 다양하다 - 웹 (HTTP) 서버, FTP 서버, CD-ROM 디스크, 네트워크 서버 (등..). (예컨데 Sarge 릴리즈의 경우) CD 14장에 포함된 패키지를 모두 다운로드하지 않으므로 일반 사용자들은 인터넷으로부터 패키지를 다운로드 하는 편이다.

소스를 직접 편집하는 방법

소스위치가 저장된 파일을 직접 고치는 방법은 다음과 같다:

?root 권한으로 /etc/apt/sources.list 를 편집한다.

You should read the manual for this configuration file first - type "man sources.list" at a console window. You could also read the sources.list page.

Using apt-setup

You can use the apt-setup tool which generates automatic source lines and adds them to the /etc/apt/sources.list (the file which configures your apt sources). Note: apt-setup doesn't wipe your existing configuration - it simply appends more sources. apt-setup is a debconf wizard.

Note: apt-setup was part of base-config which is no longer available in DebianEtch or DebianUnstable, please refer to DebianInstaller/RemoveBaseConfig and to for details.

Open a root console

# apt-setup

Follow the Wizard!

Using apt-spy

apt-spy will generate a sources.list file (the configuration file for apt package sources) for you! It measures the latency and bandwidth to servers, and picks the best one.

To get started, you'll need to install it, and then read how to use it:

Open a root console

aptitude install apt-spy

When using apt-spy you need to at least include -d and the Debian distribution you want to check. Example first time usage:

# apt-spy -d stable

This command will check all the Debian stable repositories to see which ones are the fastest. If you want to only check the repositories where you live at you would include -a and the location which includes North America, South America, Asia, Europe, and Australia and New Zealand.

Apt-spy options

Using a graphical program

If you are using Gnome (I don't know for KDE) which is the default in Debian, you can configure your Apt sources with a graphical program. You will found it in:

You'll be prompted for Root password

Installing Packages

Open a root console

# aptitude install <package>


To reinstall a package type in a terminal:

aptitude reinstall <package>

To reinstall with all dependencies, type:

# aptitude reinstall <package> $(apt-cache depends --recurse --installed <package> ||grep '[ ]')

Removing a Package

# aptitude remove <package>

where <package> is the name of the package (application) you want to remove.

To also delete files and directories created by the package after installation, such as configuration or status (Warning: this may include files modified by the user), use:

# aptitude purge <package>

패키지 업그레이드 하기

root 콘솔을 열고 다음 형식에 맞게 실행한다:

# aptitude upgrade <package>

여기서 <package> 부분은 업그레이드 할 패키지 (응용 프로그램) 이름을 넣는다.

시스템에 설치된 패키지들을 새 버전으로 유지하기

root 콘솔을 열고 다음을 실행한다:

# aptitude update
# aptitude upgrade

이것은 "간섭없이" 패키지 업그레이드를 실행한다.

# aptitude dist-upgrade

Check the packages to be REMOVED: Any package lib<foo> is fine. If it's removing something you use, and there is nothing obviously replacing it (e.g. emacs20 replaced by emacs21), you may want to make yourself a note so you can reinstall it later (when a compatible package is available), or "pin" that package (see "man apt_preferences") before doing the "dist-upgrade".

Search for packages

Open a console

$ apt-cache search <string>

where <string> is a list of keywords to search for.

You may want to pipe the output (redirect the output) into "less" (a scrollable viewer) since the list may be huge:

$ apt-cache search <string> | less

List installed packages

Open a console

$ dpkg --list

Further Reading