• OpenSolaris Package Manager的命令行程序pkg的使用方法

    Date: 2008.05.28 | Category: Sun | Tags: ,,,,

    For­ward from: http://ipv5.wordpress.com/2008/05/11/quick-opensolaris-pkg-howto/

    Well, time for me to learn YAPMSTM (Yet Ano­ther Package Mana­ge­ment System).

    Open­so­la­ris 2008.05 ships with the IPS Image Packa­ging System, which, even if it’s got very few packa­ges, has both command line and gui tools.

    sea­rch for an insta­lled package:

    # pkg list -s | egrep or whatever you like
    NAME (AUTHORITY) SUMMARY
    FSWxorg-fonts X.Org Foundation X11 fonts
    SUNW1394 Sun IEEE1394 Framework
    SUNWDTraceToolkit SUNWDTraceToolkit

    or

    # pkg search -l zip
    INDEX ACTION VALUE PACKAGE
    basename file usr/bin/zip pkg:/SUNWzip@2.32-0.86
    # pkg info -l pkg:/SUNWzip@2.32-0.86
    Name: SUNWzip
    Summary: The Info-Zip (zip) compression utility
    State: Installed
    Authority: opensolaris.org (preferred)
    Version: 2.32
    Build Release: 5.11
    Branch: 0.86
    Packaging Date: Sat Apr 26 18:12:56 2008
    Size: 167 kB
    FMRI: pkg:/SUNWzip@2.32,5.11-0.86:20080426T181256Z
    # pkg contents pkg:/SUNWzip@2.32-0.86
    PATH
    usr
    usr/bin
    usr/bin/zip
    usr/bin/zipcloak
    usr/bin/zipnote
    usr/bin/zipsplit

    check for upda­ted packa­ges:

    # pkg list -u
    NAME (AUTHORITY) VERSION STATE UFIX
    entire 0.5.11-0.86 installed u—
    openoffice 2.4.0-0.86 installed u—

    sea­rch for and install new packa­ges:

    # pkg search -r rdesktop
    INDEX ACTION VALUE PACKAGE
    basename file usr/bin/rdesktop pkg:/SUNWrdesktop@0.5.11-0.86
    basename file usr/bin/rdesktop pkg:/SUNWrdesktop@0.5.11-0.86
    # pkg install -n -v SUNWrdesktop
    Before evaluation:
    UNEVALUATED:
    +pkg:/SUNWrdesktop@0.5.11,5.11-0.86:20080426T180128Z


    After evaluation:
    None -> pkg:/SUNWrdesktop@0.5.11,5.11-0.86:20080426T180128Z
    None
    # pkg install -v SUNWrdesktop
    Before evaluation:
    UNEVALUATED:
    +pkg:/SUNWrdesktop@0.5.11,5.11-0.86:20080426T180128Z

    After evaluation:
    None -> pkg:/SUNWrdesktop@0.5.11,5.11-0.86:20080426T180128Z
    None
    DOWNLOAD PKGS FILES XFER (MB)
    Completed 1/1 42/42 0.27/0.27

    PHASE ACTIONS
    Install Phase 55/55

    add other repo­si­to­ries:

    # pkg set-authority -O http://pkg.sunfreeware.com:9000 sunfreeware.com
    # pkg set-authority -O http://blastwave.network.com:10000 blastwave.org
    # pkg authority
    AUTHORITY URL
    opensolaris.org (preferred) http://pkg.opensolaris.org:80/
    blastwave.org http://blastwave.network.com:10000/
    sunfreeware.com http://pkg.sunfreeware.com:9000/
    # pkg refresh –full

    uh?:

    # pkg info -l pkg:/openoffice@2.4.0-0.86
    Name: openoffice
    Summary: Base module for OpenOffice.org 2.4
    State: Installed
    Authority: opensolaris.org (preferred)
    Version: 2.4.0
    Build Release: 5.11
    Branch: 0.86
    Packaging Date: Thu Apr 24 10:48:39 2008
    Size: 420.6 MB
    FMRI: pkg:/openoffice@2.4.0,5.11-0.86:20080424T104839Z


    # pkg info -r pkg:/openoffice@2.4.0-0.86
    Name: openoffice
    Summary: Base module for OpenOffice.org 2.4
    State: Not installed
    Authority: opensolaris.org (preferred)
    Version: 2.4.0
    Build Release: 5.11
    Branch: 0.86
    Packaging Date: Mon Apr 28 16:36:48 2008
    Size: 420.6 MB
    FMRI: pkg:/openoffice@2.4.0,5.11-0.86:20080428T163648Z

    I won­der why the build release does not inc­re­ment… oh, well, it does not do it even for entire it does seem…

    upda­ting the system:

    # pkg image-update -n -v
    Before evaluation:
    UNEVALUATED:
    +pkg:/entire@0.5.11,5.11-0.86:20080504T125439Z

    After evaluation:
    pkg:/entire@0.5.11,5.11-0.86:20080426T182618Z -> pkg:/entire@0.5.11,5.11-0.86:20080504T125439Z
    None
    # pkg image-update -v
    Before evaluation:
    UNEVALUATED:
    +pkg:/entire@0.5.11,5.11-0.86:20080504T125439Z

    After evaluation:
    pkg:/entire@0.5.11,5.11-0.86:20080426T182618Z -> pkg:/entire@0.5.11,5.11-0.86:20080504T125439Z
    None
    PHASE ACTIONS
    Update Phase 1/1
    Install Phase 3/3
    A clone of opensolaris exists and has been updated and activated. On next boot the Boot Environment opensolaris-1 will be mounted on ‘/’. Reboot when ready to switch to this updated BE.
    # zfs list
    NAME USED AVAIL REFER MOUNTPOINT
    rpool 3.18G 14.0G 56.5K /rpool
    rpool@install 18.5K - 55K -
    rpool/ROOT 2.95G 14.0G 18K /rpool/ROOT
    rpool/ROOT@install 15K - 18K -
    rpool/ROOT/opensolaris 233K 14.0G 2.12G legacy
    rpool/ROOT/opensolaris-1 2.95G 14.0G 2.12G legacy
    rpool/ROOT/opensolaris-1@install 352M - 2.22G -
    rpool/ROOT/opensolaris-1@static:-:2008-05-10-22:50:27 44.0M - 2.12G -
    rpool/ROOT/opensolaris-1/opt 450M 14.0G 450M /opt
    rpool/ROOT/opensolaris-1/opt@install 121K - 3.61M -
    rpool/ROOT/opensolaris-1/opt@static:-:2008-05-10-22:50:27 0 - 450M -
    rpool/ROOT/opensolaris/opt 0 14.0G 450M /opt
    rpool/export 233M 14.0G 19K /export
    rpool/export@install 15K - 19K -
    rpool/export/home 233M 14.0G 233M /export/home
    rpool/export/home@install 19K - 21K -

    • Share/Bookmark