[ 이전 ] [ 차례 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ] [ 12 ] [ 13 ] [ 다음 ]


APT HOWTO
7 - Tricks and Techniques


7.1 "on demand" 패키지 설치하는 방법

프로그램을 컴파일 하고 있는데 멈춰버렸다! 이는 여러분이 필요한 .h 파일이 없기 때문이다. auto-apt은 그러한 상황을 막아줄 것이다. 필요한 패키지라면 그 패키지를 설치하라고 하고 과정을 멈추고 패키지가 설치된 후에 과정을 계속 진행해 나갈 것이다.

여러분이 기본적으로 할 일은 다음을 실행하는 것이다:

     # auto-apt run command

Where command is the command to be executed that may need some unavailable file. For example:

     auto-apt run ./configure

필요한 패키지들을 설치하도록 요구하고 따라서 자동적으로 apt-get을 호출한다. X를 실행하면 그래픽 인터페이스가 기본 텍스트 인터페이스를 대체할 것이다.

Auto-apt은 효율적으로 최신으로 데이타베이스를 유지한다. 이는 다음의 명령을 통해서 가능하다:auto-apt update, auto-apt updatedb와 auto-apt update-local.


7.2 패키지 관리하기

If you are dealing with several machines in a network it might be useful to have a package caching system, so that you will not have to download the packages for each machine. This manual will focus on the apt-proxy package, which does exactly that. Other solutions exist, like apt-cacher, though. You may want to try each one to choose the one that best fits your needs.

First of all, install the apt-proxy package. It will register itself on inetd to listen for requests on port 9999, you may need to restart the inetd service.

Next you'll want to edit the /etc/apt-proxy/apt-proxy.conf file. It lists the real servers apt-proxy will use to download the package lists and packages from. You can use http, ftp and rsync as transfer methods. The file comes with a default "backend" that looks like this:

     add_backend /debian/                                    \
             $APT_PROXY_CACHE/debian/                        \
             http://ftp.us.debian.org/debian/                \
             http://ftp.de.debian.org/debian/                \
             http://ftp.uk.debian.org/debian/                \
             +ftp.us.debian.org::debian/

This means that whenever a client tries to get something from /debian/ apt-proxy will use its cache, the listed Debian http mirrors and one rsync server, which is preferred for downloading the package lists (the "+" sign means prefered for control files).

How, then, a client will use this backend  By adding the following line at the /etc/apt/sources.list file at the clients (including the box in which apt-proxy is installed):

     deb http://server:9999/debian/ stable main

The line looks much like a normal line. The difference here is you put your apt-proxy server where you would normally put an http or ftp mirror, uses a port value (9999) and then select the backend (/debian/). After having done all this initial setup update the list of packages at one of the machines and upgrade it first, so that it will only download a package one time. After the first machine is up-to-date update the others.

You can use the apt-proxy-import command to import the packages that are inside your current APT cache (/var/cache/apt/archives/) by running apt-proxy-import /var/cache/apt/archives. Notice that you must have run the update process in at least one client to initiate the apt-proxy's cache before using apt-proxy-import.

You can learn more about apt-proxy by reading the comments that populate the /etc/apt-proxy/apt-proxy.conf file. To setup http and ftp proxies for apt-proxy to use, for example, you will find example configurations at the end of the file.


7.3 어떠한 미러가 sources.list에 가장 좋은 곳인지 선택해주는 것은: netselect, netselect-apt

새로운 사용자들 대부분이 의심하는 것은: "어떠한 데비안 미러를 사용해서 sources.list에 포함시킬까"하는 것이다. 어떤 미러를 선택하는 방법은 여러가지가 있다. 전문가들은 스크립트를 이용해서 몇개의 서버로 ping 시간을 측정하는 스크립트를 갖고 있지만 이를 도와주는 프로그램이 있다: netselect.

netselect를 설치하기 위해서는 다음과 같다:

     apt-get install netselect

파라미터가 없이 실행하면 도움말을 보여준다. 공백으로 분리된 호스트(미러)를 이용해서 실행하면서 점수와 호스트 하나를 보여준다. 이 점수는 측정된 ping 시간이며 hops(네트워크 쿼리가 목적지에 도착하면서 지나가는 호스트)의 개수와 측정된 다운로드 속도(더 낮을수록 더 낫다)에 반비례한다. 돌아오는 호스트는 더 낮은 점수를 갖게 된다(점수의 모든 리스트는 -vv 옵션을 추가하면 찾을 수 있다). 다음의 예제를 보면:

     # netselect ftp.debian.org http.us.debian.org ftp.at.debian.org download.unesp.br ftp.debian.org.br
       365 ftp.debian.org.br
     #

이 의미는 netselect에 파라메타에 포함된 미러로부터 ftp.debian.org.br가 가장 좋다고 나왔고 점수는 365였다. (주의! 이는 필자의 컴퓨터에서 한 것이고 네트워크 상황은 접근 지점에 따라서 매우 다를 수 있으니 이 값은 다른 컴퓨터에서도 항상 같은 것은 아니다.)

지금은 /etc/apt/sources.list에 netselect에 의해 가장 빠른 미러를 넣고 (/etc/apt/sources.list 파일, 3.1 참고) 패키지 관리하기, 4에 있는 팁을 따른다.

참고: 미러의 리스트는 항상http://www.debian.org/mirror/mirrors_full에서 확인할 수 있다.

0.3.ds1 버젼으로 시작했던 netselect 패키지는 netselect-apt를 포함하고 있고 이는 위의 과정을 자동화 시켜준다. 파라메타로 디스트리뷰션 트리를 입력하고(기본은 안정이다) sources.list 파일이 가장 좋은 main과 non-US 미러가 생기고 현재의 디렉토리에 저장될 것이다. 다음의 예제는 안정 디스트리뷰션의 sources.list를 만들어낸다:

     # ls sources.list
     ls: sources.list: File or directory not found
     # netselect-apt stable
     (...)
     # ls -l sources.list
     sources.list
     #

기억할 것: sources.list 파일은 현재의 디렉토리에 생기고 반드시 /etc/apt로 옮겨져야 한다.


7.4 사용하지 않는 로컬의 locale 파일들 지우기: localepurge

많은 데비안 사용자들은 자신만의 locale을 사용한다. 한국어 사용자의 경우 대부분이 ko_KR.EUC-KR를 사용한다. 원문에는 pt_BR로 나와있다. 요즘은 한국어 사용자중 UTF-8사용자도 꾸준히 늘고 있는 상태이다.

localepurge는 사용하지 않는 locale들을 지울 때 사용하게 된다. 단지 apt-get install localepurge 하면 된다.

설정하는 것은 매우 쉽다. 단지 debconf이 묻는 질문에만 잘 대답하면 된다. 단지 첫번째 질문에만 조심해서 답변을 해야하는데 잘못하며 여러분이 사용하는 locale을 포함해서 모든 locale을 지울 수 있다. 이를 복구 하려면 이것들을 제공하는 패키지들을 재설치해야한다.


7.5 패키지의 변화된 정보를 얻기

모든 패키지는 자신의 문서 디렉토리(/usr/share/doc/packagename)에 changelog.Debian.gz라는 파일이 있는데 마지막 버젼이후로 패키지의 변화된 내용을 포함하고 있다. zless의 도움을 받아 이러한 파일을 읽을 수 있지만 그리 쉽지는 않고 전체 시스템 업그레이드 하자마자 모든 업그레이드 된 changelog를 찾기 시작한다.

이러한 작업을 자동화 해주는 방법이 있는데 apt-listchanges을 이용하면 된다. 우선은 apt-listchanges 패키지를 우선 설치하고 패키지 설치동안 Debconf가 이를 설정해 줄것이다. 여러분이 원하는대로 질문에 답을 하면 된다.

"Should apt-listchanges be automatically run by apt "라는 것은 매우 유용한데 업그레이드 동안 apt에 의해 설치되는 각 패키지의 변화 목록을 보여주게 해주기 때문이다. 그리고 계속 진행하기 전에 이를 분석하게 해준다. "Should apt-listchanges prompt for confirmation after displaying changes "는 여러분이 변화의 내용을 읽은 후에 설치를 계속할 것인지를 묻기 때문이다. 계속 원하지 않는다고 하면 apt-listchanges를 에러를 apt는 설치를 중단하게 된다.

apt-listchanges가 설치된 이후애 apt에 의해서 패키지가 다운로드 되거나 CD에서 가지고 오거나 마운트된 디스크에서 가져오자 마자 설치되기 전에 패키지에 변화된 내용의 리스트를 보여주게 된다.


[ 이전 ] [ 차례 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ] [ 12 ] [ 13 ] [ 다음 ]


APT HOWTO

2.0.2 - October 2006

Gustavo Noronha Silva kov@debian.org
한국어 번역: 양유성 yooseong@debian.org