pkg_add
—
???եȥ????????? package
?ȡ??뤹???ץ???????
pkg_add
[-vInfrRMS
]
[-t
template]
[-p
prefix]
[-C
chrootdir]
pkg-name [pkg-name ...]
pkg_add
???ޥ??ɤϡ?
pkg_create(1)
???ޥ??ɤˤ??????????줿 package (????: FreeBSD ??
package system
?ˤ??????ѥå????????ؤ??????ˤ???ɽ?????ޤ?)
??Ÿ???????Τ??Ѥ??????ޤ???
pkg_add
???ޥ??ɤ?
package
?ե??????˴ޤޤ??륹?????ץȤ??ץ?????????
?¹Ԥ??뤳?Ȥ??????Τǡ????ʤ??Υ????ƥ??ϡ??????????ۥե???????
?????˰??ͤ?????
“
?ȥ?????????”
??¾?ι?̯?ʹ????ʤɤ???????
??ǽ?????????ޤ???
package
?ե?????????????ʪ??ǽ?Ϥȿȸ?????ǧ?????Ȥ褤?Ǥ??礦??
?????ʤ????????Τ????ˤϡ?package
??Ÿ???????Τ? -M
?ե饰???Ѥ??????????Ƥȡ????????ץȤ??????ƥ??˳????ܤ??ʤ?????
??ǧ???ޤ??? +INSTALL, +POST-INSTALL, +DEINSTALL, +REQUIRE,
+POST-INSTALL, +REQUIRE, +MTREE_DIRS
?γƥե??????ˤ?
?ä????դ?ʧ????+CONTENTS ?ե???????
@cwd
, @mode
(setuid
???????å?), @dirrm
,
@exec
, @unexec
?ǥ??쥯?ƥ??֤?Ĵ?٤Ƥ?????????
package ?ե???????Ĵ?٤??Τˤ?
pkg_info(1)
???ޥ??ɤ??Ȥ??ޤ???
?ʲ??Υ??ޥ??ɥ饤?ץ????????????Ƥ??ޤ?:
- pkg-name [pkg-name ...]
- ???ꤵ?줿 package
?????ȡ??뤵???ޤ???
-
?Ȥ???̾???????ꤵ?????ȡ?
pkg_add
?? stdin
?????ɤ߹??ߤޤ??? package
?????????ȥǥ??쥯?ȥ??˸??Ĥ????ʤ??ȡ?
pkg_add
?? PKG_PATH
?ǻ??ꤵ?줿?ƥǥ??쥯?ȥ???õ???ޤ???
-v
- ?????ʽ??Ϥ??ڤ??ؤ??ޤ???
-I
- package ?˥??ȡ????ѥ??????ץ?
(pre-install ?ޤ??? post-install)
??¸?ߤ??Ƥ⡢???????¹Ԥ??ޤ?????
-n
- ?ºݤˤϥ??ȡ??????Ԥ鷺?????ȡ??뤷???????˼¹Ԥ??????Ǥ?????
???ƥåפ?ɽ?????ޤ???
-R
- package
?Υ??ȡ??????̤???Ͽ???ޤ?????
???Υ??ץ??????ϡ????ǥ??ȡ??뤹?뤳?Ȥ??Բ?ǽ?ˤ??뤿?ᡢ
??ʬ?????Ƥ??뤫?????Ƥ????ͤΤȤäƤ?????????
-r
- ???⡼?ȥե??å???ǽ?????Ѥ??ޤ???
Ŭ?ڤʥ??֥??????ȷ????ȥ?????????ꤷ?Ƥ??顢
package ?????????ƥ??ȡ??뤷?ޤ???
-f
- ???餫????ɬ?פ? package
?????ȡ??뤵???Ƥ??ʤ??ä??ꡢ
requirements
???????ץȤ????Ԥ????????ˤ??Ū?˥??ȡ??뤷?ޤ???
??????
pkg_add
?????Ĥ????ʤ?ɬ?פ? package
??õ???Ƽ?ưŪ?˥??ȡ??뤹?뤳?Ȥ?
?ߤ????櫓?ǤϤʤ??????Ĥ????ʤ??????Ǥ????Ǥ??ʤ??褦?ˤ??ޤ???
-p
prefix
- package
?????ե???????Ÿ???????ǥ??쥯?ȥ???????
prefix ???դ??ޤ??? package
???ǥե????ȥǥ??쥯?ȥ????ݻ????Ƥ????????ˤϡ?
???Υ??ץ????????ѹ??Ǥ??ޤ???
pkg_add
?ϥǥ??쥯?ȥ????꤬????Ū?˹Ԥ????Ƥ??뤫??????Ū?˹Ԥ????Ƥ??뤫
???Τ??Ѥ??ʤ??Τǡ??ǽ???
@cwd
?ǥ??쥯?ƥ??֤Τߤ??ѹ??????뤳?Ȥ????դ??Ƥ?????????
ʣ?????Υǥ??쥯?ȥ??ѹ????Ԥ????뤳?ȤϤޤ??Ǥ?????
?ºݤˤ??ä????硢???٤ƤΥǥ??쥯?ȥ??ѹ??????椷?????ʤ?
?Ǥ??礦?? ???ξ??硢 MASTER
?⡼?ɡ? SLAVE
?⡼?ɤλ??Ѥ???Ƥ???ƤߤƤ???????
(???ץ????? -M
?? -S
??)??
-t
template
- “?????ΰ?” ???????????ݤˡ?
mktemp(3)
?ؤ????ϤȤ??? template
???Ѥ??ޤ???
?????ϥǥե????ȤǤ?
/var/tmp/instmp.XXXXXX
?Ȥ???ʸ?????Ǥ????? /var/tmp
?ǥ??쥯?ȥ??????̤????¤????Ƥ????褦?ʾ????Ǥ?
?ѹ?????ɬ?פ????뤫?⤷???ޤ?????
mktemp(3)
?????դ? ID ???Ѥ??뤿????ɬ?פ? `X'
??ʸ?????Ĥ??Ĥ??Ƥ???
???Ȥ?˺???ʤ??Ǥ?????????
?????ΰ? template ?? package
?ե????뤬???ȡ??뤵?????ǥ??쥯?ȥ???Ʊ???ǥ?????
?ѡ??ƥ????????????ꤹ?뤳?Ȥˤ??äơ??ѥե????ޥ??????뤳?Ȥ?
??ǽ?Ǥ? (?????? /usr )??
-M
MASTER
?⡼?ɤǼ¹Ԥ??ޤ??? ??????
pkg_add
?ΤȤƤ??ü??ʼ¹ԥ⡼?ɤǤ??ꡢ
SLAVE
?⡼?ɤȶ??˼¹Ԥ??ʤ????Фʤ??ޤ?????
???Υ⡼?ɤǼ¹Ԥ??????ȡ?
pkg_add
?ϰ???Ū?ʺ????ΰ?
( -t
???ץ???????) ?? package
??Ÿ???????ʾ??Τ??ȤϤ?????
???ߤκ????ΰ??ǥ??쥯?ȥ?̾??Ƭ???ղä???
packing list ??ɸ?????Ϥ?
???Ϥ??ޤ?(ɸ?????Ϥ?
sed(1)
?Τ褦?ʥץ????????˥ե??륿?????Ƥ??뤫?⤷???ޤ???)??
SLAVE
?⡼?ɤȶ????Ѥ????ȡ????Ȥ?????????????
package ??¤??
?礭???ѹ????ä??뤳?Ȥ???ǽ?ˤʤ??ޤ???
-S
SLAVE
?⡼?ɤǼ¹Ԥ??ޤ??? ??????
pkg_add
?ΤȤƤ??ü??ʼ¹ԥ⡼?ɤǤ??ꡢ
MASTER
?⡼?ɤȶ??˼¹Ԥ??ʤ????Фʤ??ޤ?????
???Υ⡼?ɤǼ¹Ԥ??????ȡ?
pkg_add
?? package
?????Ƥ????Ǥ˺????ΰ???Ÿ?????졢???ξ??꤬
ɸ?????Ϥ???ʸ?????Ȥ??????Ϥ????뤳?Ȥ????ꤷ?ޤ???
?????? packing list ?? stdin
?????ɤ߹??ޤ졢???θ????Ȥ?
?̾??ɤ????????????ޤ???
-C
chrootdir
- ???????Ԥʤ????ˡ? ?ǥ??쥯?ȥ?
chrootdir ???Ф???
chroot(2)
???¹Ԥ????ѥå??????ե??????ȥѥå??????ǡ????١?????
chrootdir
?˥??ȡ??뤵???Ƥ????褦?ˤ??ޤ???
chrootdir ?ϡ?
pkg_add
?μ¹Ԥ??̾?ɬ?פʤ??Τ??٤Ƥ??ޤࡢ
???????ٴ????ʥե????륷???ƥ??Ǥ???ɬ?פ??????ޤ???
???Υե饰?ϡ?
sysinstall(8)
???¹Ԥ????????Υ??ݡ??Ȥ??ٱ礹?뤿?????ɲä????ޤ?????
????¾?????Ӥ?????Ω?Ĥ褦?ˤȤ??????ȤǤϤ????ޤ?????
chrootdir
??Ŭ?ڤ????ꤵ?졢?̾??Υ桼?????ѹ??Ǥ??ʤ??褦?ˤ??뤳?ȡ?
fetch(1)
?Τ褦?ʤ????Ĥ??Υ??ޥ??ɤ?
chrootdir
????¦?Ǽ¹Ԥ????뤳?Ȥ????դ??Ƥ?????????
???İʾ??? pkg-name
?????????ꤹ?뤳?Ȥ???ǽ?ǡ????????? package
???ޤ??ե?????̾ (?̾? ??ĥ??
“.tbz” ?ǽ??????ޤ?) ????ftp
?????Ȥˤ????ե??????? ???? URL
?Τɤ??餫?ˤʤ??ޤ???
???????äơ?anonymous ftp
????ľ?ܥե???????Ÿ?????뤳?Ȥ?
??ǽ?Ǥ? (?㤨?? pkg_add
ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/packages/shells/bash-1.14.7.tbz
)
?? ????: ?⤷?嵭?Τ褦??ž?????Ѥ??? ftp
??
passive mode
?????Ѥ??????ʤ顢?Ķ??ѿ?
FTP_PASSIVE_MODE
?˲??餫???ͤ????ꤹ??ɬ?פ??????ޤ???
?????Ǥʤ????С?????????Ū?? ACTIVE
?⡼?ɤ????Ѥ????ޤ???
?⤷???ޤ?ư??Ƥ??뤳?Ȥ??狼?äƤ??륵???Ȥ???
package ?? ???褦?Ȥ??? pkg_add
?????˼??Ԥ??????硢???ʤ???
passive mode
?? ftp
???Ȥ?ɬ?פΤ????ե??????????????????ˤ????Τ??????Ǥ??????礬
?????ޤ???
pkg_add
?桼?ƥ????ƥ??ϡ? ??
package ?? "packing list" ?? /tmp
(???ꤵ???Ƥ????????ˤ? $PKG_TMPDIR )
???????̤ʺ??ȥǥ??쥯?ȥ???Ÿ??????
???Ȥ????Ϥ???package
?????Ƥ???????Ÿ?????뤿????
?ʲ??μ??????¹Ԥ??ޤ???
- package
?????Ǥ˥??ȡ??뤵???Ƥ??롢?ȵ?Ͽ?????Ƥ??뤫?ɤ?????
?????å????ޤ???
?⤷?????ʤ饤?ȡ????????Ǥ??ޤ???
- package ???????˥??ȡ????Ѥ? package
?Ⱦ??ͤ??뤫?ɤ??????????å????ޤ?
(
@conflicts
?ǥ??쥯?ƥ??֤??ɤߤޤ???
pkg_create(1)
??)??
?⤷?????ʤ饤?ȡ????????Ǥ??ޤ???
- packing list ?˽??Ƥ??롢package
??????¸?ط??????ޤ?
(
@pkgdep
?ǥ??쥯?ƥ??֤??ɤߤޤ???
pkg_create(1)
??)?? ?⤷ɬ?ܤ? package
?????ߥ??ȡ??뤵???Ƥ??ʤ????С?
?????Ĥ??ƥ??ȡ??뤷?褦?Ȥ??ޤ???
?ʤ? package
???ߤĤ????ʤ??ä??ꥤ?ȡ????Ǥ??ʤ??ä??ꤹ???ȡ?
???ȡ????????Ǥ??ޤ???
- package
???ɤΤ褦?˥????ƥ????ɲä????뤫?????椹??
@option
?ǥ??쥯?ƥ??֤????ޤ???
???Υޥ˥奢???ڡ??????Ƥ????????Ǥϡ??????????Ƥ??륪?ץ???????
@option extract-in-place
?ΤߤǤ??ꡢ?????? /tmp
???κ????ΰ?????ͳ???ʤ??ǡ? package
???ǽ?Ū?ʥǥ??쥯?ȥ???ľ??Ÿ???????褦?ˤ??ޤ???
- ?????ꤵ???Ƥ????С?package
?Ϻǽ?Ū?ʾ?????ľ??Ÿ?????졢
?????Ǥʤ????к????ΰ?????Ÿ???????ޤ???
- package ?? require ?ե????? (
pkg_create(1)
??)
???ޤ??Ǥ??????硢???Υե????????ʲ??ΰ??????դ??Ƽ¹Ԥ??ޤ?:
pkg-name
INSTALL
?????? pkg-name ???????Ȥ??Ƥ??? package
??̾???Ǥ??ꡢ INSTALL
??????ɤϥ??ȡ????? requirements
?????å??Ǥ??뤳?Ȥ? ?????Ƥ??ޤ?
(??????ʣ???ε?ǽ???????ҤȤĤΥ??????ץȤ?
?Ѥ??褦?Ȥ?????????ͭ?ѤǤ?)??
- package ?? pre-install
???????ץȤ?¸?ߤ??????硢?ʲ??ΰ??????դ??Ƽ¹Ԥ????ޤ?:
script
pkg-name PRE-INSTALL
?????? pkg-name ???оݤ?
package ̾?Ǥ??ꡢ PRE-INSTALL
?Ϥ??줬???ȡ??????Υե??????Ǥ??뤳?Ȥ???????ɤǤ???
??: ( -i
??????
-I
?Υե饰??
pkg_create(1)
?˻??Ѥ??뤳?Ȥˤ???) package ????????
pre-install ?? post-install
?Υ??????ץȤ??̡???Ϳ?????????????ˤϡ?
PRE-INSTALL
??????ɤ??о줷?ޤ?????
-
?????ꤵ???Ƥ??ʤ????硢packing list (
+CONTENTS ?ե?????)
???????ΰ褫???ǽ?Ū?ʾ?????
?ե?????????ư (ɬ?פʤ饳?ԡ?)
???뤿???˻??Ȥ????ޤ???
- package ?? mtreefile ?ե????? (
pkg_create(1)
??) ???ޤ????硢mtree
???ʲ??ΰ??????դ??Ƽ¹Ԥ????ޤ?:
mtree
-u
-f
mtreefile -d
-e
-p
prefix
?????? prefix ?? -p
?ե饰?????ꤵ???Ƥ????Ф??? prefix??
-p
?ե饰?????ꤵ???Ƥ??ʤ??????ˤϤ???
package ?κǽ??? @cwd
?ǥ??쥯?ƥ??֤Υǥ??쥯?ȥ?̾??
prefix ?ˤʤ??ޤ???
- package ?? post-install
???????ץȤ??ޤޤ??????硢
script
pkg-name POST-INSTALL
?Ȥ??Ƽ¹Ԥ????ޤ??? ??????
pkg-name ???оݤ? package
̾?Ǥ??ꡢ POST-INSTALL
?Ϥ??줬???ȡ??????Υե??????Ǥ??뤳?Ȥ???????ɤǤ???
??: ( -i
??????
-I
?Υե饰??
pkg_create(1)
?˻??Ѥ??뤳?Ȥˤ???) package ????????
pre-install ?? post-install
?Υ??????ץȤ??̡???Ϳ?????????????ˤϡ?
POST-INSTALL
??????ɤ??о줷?ޤ?????
POST-INSTALL ??????
PRE-INSTALL
?Υ?????ɤ??Ϥ??طʤˤϡ?
“???ȡ????????ȥ??ȡ???????ξ??”
?μ?³???ʤ????Ĥ?
install
???????ץȤ??Ѥ??뤳?Ȥ???ǽ?ˤ??뤳?Ȥ??????ޤ???
???????ʤ??顢?????ƥʥδ????????ϡ???ǽ??ʬΥ????????ͭ???????ưפǤ???
- ???ȡ??뤬??λ?????ȡ?????
pkg_delete(1)
?ǻȤ??????? packing list?? deinstall
???????ץȡ? description?? display
?γƥե????뤬
/var/db/pkg/<pkg-name>
?˥??ԡ??????ޤ??? package
?ΰ?¸?ط??ϡ?¾?? package ??
/var/db/pkg/<other-pkg>/+REQUIRED_BY
?ե????? (PKG_DBDIR
?Ķ??ѿ??????ꤷ?Ƥ??????硢?嵭??
/var/db/pkg/ ???֤??????????ޤ?)
?˵?Ͽ?????ޤ???
- ?Ǹ??ˡ??????ΰ褬?????????ץ????????Ͻ?λ???ޤ???
???٤ƤΥ??????ץȤϴĶ??ѿ?
PKG_PREFIX
?˥??ȡ???????
prefix ( ???Ҥ? -p
???ץ???????)
?????ꤵ?줿???֤Ǽ¹Ԥ????ޤ???
???Τ??Ȥˤ??ꡢpackage ?κ??Ԥ?
pkg_add
?? -p
?ե饰?ˤ??? package
?????ȡ??뤵?????ǥ??쥯?ȥ꤬
?ѹ??????Ƥ⡢???????Ȥդ??ޤ????????ץȤ????Ȥ???ǽ?ˤʤ??ޤ???
PKG_PATH
???ͤϡ????ꤵ?줿
package ?????Ĥ????ʤ??????Ѥ??????ޤ???
?Ķ??ѿ??ϥ??????Ƕ??ڤ??줿??Ϣ?Υ????ȥ??Ǥ???
?ƥ????ȥ??ϥǥ??쥯?ȥ?̾?????ʤ??ޤ???
???????ȥǥ??쥯?ȥ??϶????Υǥ??쥯?ȥ?̾?ǰ??ۤΤ????˻??ꤵ???뤫??
???ĤΥԥꥪ?ɤ?????Ū?˻??ꤷ?ޤ???
?Ķ??ѿ? PKG_DBDIR
?ϡ????ȡ??뤵?줿 package
?ˤĤ??ƤΥǡ????١????ΰ??֤????ꤷ?ޤ???
?ǥե????Ȱ??֤? /var/db/pkg
?Ǥ???
pkg_add
???????ΰ????????????ߤ??????ѥǥ??쥯?ȥ???̾???ϡ??Ķ??ѿ?
PKG_TMPDIR
?? TMPDIR
?Ȥ??? (???ν???) ???????ޤ???
?????????ѿ???¸?ߤ??ʤ????????ꤵ?줿?ǥ??쥯?ȥ??˽?ʬ?ʶ??????̤?
?ʤ????硢 pkg_add
?ϡ?
/var/tmp, /tmp,
/usr/tmp
?Τ????ǡ???ʬ?ʶ??????̤????ĺǽ??Υǥ??쥯?ȥ????Ȥ??ޤ???
?Ķ??ѿ? PACKAGEROOT
?ϡ? pkg_add
?????????Ԥ????ذ??֤????ꤷ?ޤ???
?????˻??Ѥ??? URL
?ϡ??ܴĶ??ѿ??ȡ? -r
???ץ????????ѻ??? pkg_add
????ưŪ?˥ǥ??쥯?ȥ??????ꤹ???????Ȥǡ????ۤ????ޤ???
???????? “ftp://ftp3.FreeBSD.org
”
?Ǥ???
?Ķ??ѿ? PACKAGESITE
?ϡ? pkg_add
?????????Ԥ????ذ??֤????ꤷ?ޤ???
?????ѿ??????Ѥ????ȡ? -r
???ץ????????ѻ??? pkg_add
????ưŪ?˥ǥ??쥯?ȥ??????ꤹ?????????˲??????ޤ???
???äơ??????ϥ??⡼?ȥѥå??????ե??????ؤδ?????
URL ?Ǥ??뤳?Ȥ?ɬ?פǤ???
- /var/tmp
- ?Ķ??ѿ?
PKG_TMPDIR
??
TMPDIR
?Τɤ?????Ŭ?ڤʥǥ??쥯?ȥ??????ꤷ?ʤ??????ˡ??????ΰ??????????뤿??
???Ѥ????????ѥǥ??쥯?ȥꡣ
- /tmp
- /var/tmp
??¸?ߤ??ʤ???????ʬ?ʶ??????̤??????ʤ????硢???μ??????Ф???
?ǥ??쥯?ȥꡣ
- /usr/tmp
- /var/tmp ?? /tmp
?Τɤ??????????ΰ????????????ˤ?Ŭ?ڤǤʤ????硢?Ǹ??????Ф???
?ǥ??쥯?ȥꡣ
- /var/db/pkg
- ???ȡ??뤵?줿 package
?ˤĤ??ƤΥǡ????١????Υǥե????Ȥΰ??֡?
John Kohl ⟨jtk@rational.com⟩
????ʪ?Υե??????֤Υϡ??ɥ??ϡ?
(1)
?????ΰ褬???ե??????ؤΤ??٤ƤΥ??κǽ?Ū??
?ǥ??쥯?ȥ???Ʊ???ե????륷???ƥ??ξ????⤷???ϡ?
(2) ?ե??????ؤΤ??٤ƤΥ???
contents ?ե????????? @cwd
?ǥ??쥯?ƥ??֤dz??????Ƥ????????ˤΤ???¸?????ޤ???
?????? ???ξ塢??????̾??ñ????
tar
???ޥ??? (
sysconf
(_SC_ARG_MAX)
?ˤ????֤??????ͤ˰?¸?????¹Ի??ΰ?????Ĺ???????¤ˤ??ꡢʣ????
?¹Ԥˤ?ʬ???Ǥ??ޤ???)
??Ÿ???????ʤ????Фʤ??ޤ?????
?Х???¾?ˤ⤢???Ϥ??Ǥ???