[ ÀÌÀü ] [ Â÷·Ê ] [ 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