5.4. packages ¥·¥¹¥Æ¥à¤ÎÍøÍÑ

´ó¹Æ: Chern Lee.

FreeBSD ¤Ë¤Ï packages ¤ò´ÉÍý¤¹¤ë¥Ä¡¼¥ë¤¬Ê£¿ô¤¢¤ê¤Þ¤¹¡£

5.4.1. package ¤Î¥¤¥ó¥¹¥È¡¼¥ë

pkg_add(1) ¤Ï¡¢¥í¡¼¥«¥ë¥Õ¥¡¥¤¥ë¤ä¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Î¥µ¡¼¥Ð¤«¤é FreeBSD ¥½¥Õ¥È¥¦¥§¥¢ package ¤ò ¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤¿¤á¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ç¤¹¡£

例 5-1. ¼êÆ°¤Ç package ¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤Æ¥í¡¼¥«¥ë¤«¤é¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë

# ftp -a ftp2.FreeBSD.org
Connected to ftp2.FreeBSD.org.
220 ftp2.FreeBSD.org FTP server (Version 6.00LS) ready.
331 Guest login ok, send your email address as password.
230-
230-     This machine is in Vienna, VA, USA, hosted by Verio.
230-         Questions? E-mail freebsd@vienna.verio.net.
230-
230-
230 Guest login ok, access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd /pub/FreeBSD/ports/packages/sysutils/
250 CWD command successful.
ftp> get lsof-4.56.4.tgz
local: lsof-4.56.4.tgz remote: lsof-4.56.4.tgz
200 PORT command successful.
150 Opening BINARY mode data connection for 'lsof-4.56.4.tgz' (92375 bytes).
100% |**************************************************| 92375       00:00 ETA
226 Transfer complete.
92375 bytes received in 5.60 seconds (16.11 KB/s)
ftp> exit
# pkg_add lsof-4.56.4.tgz

(FreeBSD CD-ROM ¥»¥Ã¥È¤Î¤è¤¦¤Ê) ¥í¡¼¥«¥ë¤Ê packages ¤¬¤Ê¤¤¾ì¹ç¤Ï¡¢ pkg_add(1) ¤Ë -r ¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤ëÊý¤¬³Ú¤Ç¤·¤ç¤¦¡£ ¤³¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ï¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Æ¼Â¹Ô¤¹¤ë¤È ¼«Æ°Åª¤ËŬÀڤʥª¥Ö¥¸¥§¥¯¥È¤Î·Á¼°¤È¥ê¥ê¡¼¥¹¤òȽÃǤ·¡¢ package ¤ò FTP ¥µ¥¤¥È¤«¤é¥À¥¦¥ó¥í¡¼¥É¤·¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤¹¡£

# pkg_add -r lsof

¾å¤ÎÎã¤Ç¤ÏŬÅö¤Ê package ¤¬¥À¥¦¥ó¥í¡¼¥É¤µ¤ì¤¿¸å¡¢¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Þ¤¹¡£ ¥æ¡¼¥¶¤Ï¤³¤Î¤Û¤«¤Ë²¿¤â¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£ ¥á¥¤¥ó¤ÎÇÛÉÛ¥µ¥¤¥È¤Ç¤Ï¤Ê¤¯ FreeBSD Package ¥ß¥é¡¼¥µ¥¤¥È¤Î package ¤ò»È¤¦¤Ë¤Ï¡¢ PACKAGESITE ´Ä¶­ÊÑ¿ô¤ËÍøÍѤ·¤¿¤¤¥µ¥¤¥È¤òÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£ pkg_add(1) ¤Ï¡¢FTP_PASSIVE_MODE, FTP_PROXY, FTP_PASSWORD ¤È¤¤¤Ã¤¿´Ä¶­ÊÑ¿ô¤ò»²¾È¤¹¤ë fetch(3) ¤òÍѤ¤¤Æ¥Õ¥¡¥¤¥ë¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤Þ¤¹¡£ ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ÎÆ⦤Ǥ¢¤Ã¤¿¤ê¡¢ FTP/HTTP ¥×¥í¥­¥·¤ò»È¤¦¾ì¹ç¤Ë¤Ï¡¢ ¤³¤ì¤é¤Î´Ä¶­ÊÑ¿ô¤òÀßÄꤹ¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£ ´Ä¶­ÊÑ¿ô¤Î°ìÍ÷¤Ë¤Ä¤¤¤Æ¤Ï fetch(3) ¤ò¤´Í÷¤¯¤À¤µ¤¤¡£ ¤Þ¤¿¡¢¾å¤ÎÎã¤Ç lsof-4.56.4 ¤ÎÂå¤ï¤ê¤Ë lsof ¤ò»È¤Ã¤Æ¤¤¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£ ¥ê¥â¡¼¥È¥Õ¥§¥Ã¥Áµ¡Ç½¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ë¤Ï¡¢ package ¤Î¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤ò¼è¤ê½ü¤«¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ pkg_add(1) ¤Ï¼«Æ°Åª¤ËºÇ¿·ÈǤΥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò¼èÆÀ¤·¤Þ¤¹¡£

注意: FreeBSD-CURRENT ¤Þ¤¿¤Ï¡¢FreeBSD-STABLE ¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¡¢ pkg_add(1) ¤ÏºÇ¿·ÈǤΥ¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤Þ¤¹¡£ -RELEASE ¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ ¤½¤Î¥Ð¡¼¥¸¥ç¥ó¤Î¥ê¥ê¡¼¥¹»þ¤Ë¥Ó¥ë¥É¤µ¤ì¤¿ package ¤¬¥À¥¦¥ó¥í¡¼¥É¤µ¤ì¤Þ¤¹¡£ ¤³¤ÎÀßÄê¤Ï PACKAGESITE ¤ò¾å½ñ¤­¤¹¤ë¤³¤È¤ÇÊѹ¹¤Ç¤­¤Þ¤¹¡£ ¤¿¤È¤¨¤Ð¡¢FreeBSD 8.1-RELEASE ¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ pkg_add(1) ¤ò¼Â¹Ô¤¹¤ë¤È¥Ç¥Õ¥©¥ë¥È¤Ç ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8.1-release/Latest/ ¤«¤é packages ¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤Þ¤¹¡£ ¤â¤·¡¢pkg_add(1) ¤ò»È¤Ã¤Æ FreeBSD 8-STABLE ¤Î packages ¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤¿¤±¤ì¤Ð¡¢ PACKAGESITE ´Ä¶­ÊÑ¿ô¤ò ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8-stable/Latest/ ¤ËÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£

package ¤Ï .tgz ¤ä .tbz ¤È¤¤¤¦³ÈÄ¥»Ò¤ò»ý¤Ä¥Õ¥¡¥¤¥ë¤È¤·¤ÆÇÛÉÛ¤µ¤ì¤Æ¤ª¤ê¡¢ ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/packages/ ¤ä FreeBSD CD-ROM ¤Ë¤¢¤ê¤Þ¤¹¡£ FreeBSD 4-CD ¥»¥Ã¥È (¤Þ¤¿¤Ï PowerPak ¤Ê¤É) ¤Î CD ¤Ï¤¹¤Ù¤Æ¡¢ /packages ¥Ç¥£¥ì¥¯¥È¥ê¤Ë packages ¤¬¤¢¤ê¤Þ¤¹¡£packages ¤Î¥ì¥¤¥¢¥¦¥È¤Ï¡¢ /usr/ports ¥Ä¥ê¡¼¤Î¤â¤Î¤ÈƱÍͤǤ¹¡£ ¥«¥Æ¥´¥ê¤´¤È¤Ë¥Ç¥£¥ì¥¯¥È¥ê¤¬¤¢¤ê¡¢ All ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¤¹¤Ù¤Æ¤Î package ¤¬¤¢¤ê¤Þ¤¹¡£

package ¥·¥¹¥Æ¥à¤Î¥Ç¥£¥ì¥¯¥È¥ê¹½Â¤¤Ï ports ¤Î¥ì¥¤¥¢¥¦¥È¤ÈƱ°ì¤Ç¤¹¡£ ξ¼Ô¤¬ÁȤ߹ç¤ï¤µ¤Ã¤Æ package/port ¥·¥¹¥Æ¥à¤¬¹½À®¤µ¤ì¤Þ¤¹¡£

5.4.2. packages ¤Î´ÉÍý

pkg_info(1) ¤Ï¡¢¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë packages ¤Î°ìÍ÷¤ÈÀâÌÀ¤òɽ¼¨¤¹¤ë¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ç¤¹¡£

# pkg_info
colordiff-1.0.13    A tool to colorize diff output
docbook-1.2         Meta-port for the different versions of the DocBook DTD
...

pkg_version(1) ¤Ï¡¢¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë packages ¤Î¥Ð¡¼¥¸¥ç¥ó¤òÍ×Ìó¤·¤Æɽ¼¨¤¹¤ë¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ç¤¹¡£ package ¤Î¥Ð¡¼¥¸¥ç¥ó¤ò¡¢¸½ºß¤Î ports ¥Ä¥ê¡¼¤Î¥Ð¡¼¥¸¥ç¥ó¤È Èæ³Ó¤·¤Þ¤¹¡£

# pkg_version
colordiff                   =
docbook                     =
...

2 ÎóÌܤε­¹æ¤Ï¡¢¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¥Ð¡¼¥¸¥ç¥ó¤Î ¥í¡¼¥«¥ë ports ¥Ä¥ê¡¼¤Î¥Ð¡¼¥¸¥ç¥ó¤ËÂФ¹¤ë ¿·µì¤òɽ¤·¤Þ¤¹¡£

µ­¹æ °ÕÌ£
= ¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë package ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ï¡¢ ¥í¡¼¥«¥ë ports ¥Ä¥ê¡¼¤Î¤â¤Î¤È°ìÃפ·¤Æ¤¤¤Þ¤¹¡£
< ¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¥Ð¡¼¥¸¥ç¥ó¤Ï¡¢ ¥í¡¼¥«¥ë ports ¥Ä¥ê¡¼¤Î¤â¤Î¤è¤ê¸Å¤¤¤Ç¤¹¡£
> ¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¥Ð¡¼¥¸¥ç¥ó¤Ï¡¢ ¥í¡¼¥«¥ë ports ¥Ä¥ê¡¼¤Î¤â¤Î¤è¤ê¿·¤·¤¤¤Ç¤¹ (¤ª¤½¤é¤¯¥í¡¼¥«¥ë ports ¥Ä¥ê¡¼¤Ï¸Å¤¯¤Ê¤Ã¤Æ¤¤¤Þ¤¹)¡£
? ¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿ package ¤ò ports ¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎÃæ¤Ë¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó (¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿ port ¤¬ Ports Collection ¤«¤éºï½ü¤µ¤ì¤¿¤ê¡¢ ̾Á°¤¬Êѹ¹¤µ¤ì¤¿¾ì¹ç¤Ê¤É¤Ëµ¯¤³¤ê¤Þ¤¹)¡£
* Ê£¿ô¤Î¥Ð¡¼¥¸¥ç¥ó¤Î package ¤¬Â¸ºß¤·¤Þ¤¹¡£
! ¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿ package ¤Ï¥¤¥ó¥Ç¥Ã¥¯¥¹Ãæ¤Ë¸ºß¤·¤Þ¤¹¤¬¡¢²¿¤é¤«¤ÎÍýͳ¤Ç¡¢ ¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿ package ¤Î¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤ò¥¤¥ó¥Ç¥Ã¥¯¥¹Ãæ¤Î¥¨¥ó¥È¥ê¤ÈÈæ³Ó¤Ç¤­¤Þ¤»¤ó¡£

5.4.3. package ¤Îºï½ü

¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë package ¤òºï½ü¤¹¤ë¤Ë¤Ï¡¢ pkg_delete(1) ¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤ò»È¤Ã¤Æ¤¯¤À¤µ¤¤¡£

# pkg_delete xchat-1.7.1

pkg_delete(1) ¤Ï package ̾¤È¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤ÎξÊý¤òɬÍפȤ·¤Þ¤¹¡£ ¤¹¤Ê¤ï¤Á¡¢Àè¤Û¤É¤ÎÎã¤Ë¤ª¤¤¤Æ xchat-1.7.1 ¤ò xchat ¤È¤·¤¿¾ì¹ç¤Ë¤ÏÆ°ºî¤·¤Þ¤»¤ó¡£ ¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë package ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ï¡¢ pkg_version(1) ¤ò»È¤¦¤È´Êñ¤ËÄ´¤Ù¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ ¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤Î¤«¤ï¤ê¤Ë¥ï¥¤¥ë¥É¥«¡¼¥É¤â»È¤¨¤Þ¤¹¡£

# pkg_delete xchat\*

¾å¤ÎÎã¤Ç¤Ï¡¢Ì¾Á°¤¬ xchat ¤Ç»Ï¤Þ¤ë¤¹¤Ù¤Æ¤Î packages ¤¬ºï½ü¤µ¤ì¤Þ¤¹¡£

5.4.4. ¤½¤Î¾

package ¤Ë´Ø¤¹¤ë¤¹¤Ù¤Æ¤Î¾ðÊó¤Ï /var/db/pkg ¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤ËÃÖ¤«¤ì¤Æ¤¤¤Þ¤¹¡£ ¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î²¼¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¤ÎÃæ¤Ë¡¢ ¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î°ìÍ÷¤ä¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿³Æ package ¤Ë¤Ä¤¤¤Æ¤ÎÀâÌÀ¤¬´Þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£

ËÜʸ½ñ¡¢¤ª¤è¤Ó¾¤Îʸ½ñ¤Ï ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/ ¤«¤é¥À¥¦¥ó¥í¡¼¥É¤Ç¤­¤Þ¤¹¡£

FreeBSD ¤Ë´Ø¤¹¤ë¼ÁÌ䤬¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢¥É¥­¥å¥á¥ó¥È ¤òÆɤó¤À¾å¤Ç <questions@FreeBSD.org> ¤Þ¤Ç (±Ñ¸ì¤Ç) Ï¢Íí¤·¤Æ¤¯¤À¤µ¤¤¡£
ËÜʸ½ñ¤Ë´Ø¤¹¤ë¼ÁÌä¤Ë¤Ä¤¤¤Æ¤Ï¡¢<doc@FreeBSD.org> ¤Þ¤ÇÅŻҥ᡼¥ë¤ò (±Ñ¸ì¤Ç) Á÷¤Ã¤Æ¤¯¤À¤µ¤¤¡£