服务器 频道

命令行方式使用Product Registry

二、 远程使用Product Registry的技巧

    远程访问是多用户操作系统如solaris和它的先辈(如VAX)的特点,不像单用户的W1ndows 9x系统,用户可以从任何支持TCP/IP的客户端如solaris、Linux、Windows上并发登录在solaris服务器系统上交互地执行命令,它支持许多用户在向一时间登录而只会对内存和CPU性能产生影响。首先应当启动SSH服务然后使用putty等工具登录solaris 服务器使用Product Registry。

    1 卸载一个或者多个软件

    可以使用 prodreg 命令的 uninstall 子命令来从系统中删除软件。在使用 prodreg uninstall 命令卸载软件时,会同时删除指定的软件以及与该软件相关的所有子组件。在删除软件之前,检验其他软件是否依赖要卸载的软件。在卸载软件之后,可以使用 prodreg unregister -r 命令从“Solaris 产品注册”中删除该软件及其所有的子组件。步骤如下:

 成为超级用户或承担等效角色。
 查看有关要卸载的软件的信息。
    # prodreg browse -u name-UUID

 卸载该软件。
    # prodreg uninstall -u name-UUID


 检查要卸载的软件的相关性。
    # prodreg info -u name-UUID
    在 prodreg info 命令的输出中查看以下信息。

    Child Components(子组件)-列出与 name 软件组件相关的软件组件。在注销 name 软件时,还会同时注销 name 软件的子组件。如果上述 prodreg info 命令的输出中列出了任何子组件,请检验是否要注销这些子组件。

    Required Components(必需组件)-列出 name 软件组件所必需的软件组件。软件组件可能需要的其他组件并不是子组件。在卸载和注销某个组件时,将只卸载和注销子组件。

    Dependent Components(依赖组件)-列出要求运行 name 软件的组件。在注销 name 软件时,还会同时注销 name 软件的依赖组件。如果 prodreg info 命令的输出中列出了任何依赖组件,请检验是否要注销这些依赖组件。

 检查 name 软件的子组件的相关性。
 注销软件及其子组件。

    # prodreg unregister -r -u name-UUID -i 1

    2 应用实例:

    下面的示例演示如何卸载 ExampleSoft 软件及其所有的子组件。

# prodreg browse -m "ExampleSoft" BROWSE # +/-/. UUID # NAME ======== ===== ==================================== = ============ 1 - root 1 System Registry 2 + a01ee8dd-1dd1-11b2-a3f2-0800209a5b6b 1 Solaris 10 System Software 3 + 8f64eabf-1dd2-11b2-a3f1-0800209a5b6b 1 Unclassified Software 1423 - 95842091-725a-8501-ef29-0472985982be 1 ExampleSoft 1436 . 90209809-9785-b89e-c821-0472985982be 1 Example Doc 1437 - EXSOzzt 1 Example Data 1462 . EXSOblob 1 Example Data # prodreg uninstall -u 95842091-725a-8501-ef29-0472985982be -i 1 # prodreg info -u 95842091-725a-8501-ef29-0472985982be Title: ExampleSoft Software . . Child Components: Name UUID # -------------------------- ------------------------------------ - Example Doc 90209809-9785-b89e-c821-0472985982be 1 Example Data EXSOzzt 1 Required Components: Name UUID # -------------------------- ------------------------------------ - Example Doc 90209809-9785-b89e-c821-0472985982be 1 Example Data EXSOzzt 1 # prodreg info -u 90209809-9785-b89e-c821-0472985982be -i 1 -a "Dependent Components" Dependent Components: Name UUID # --------------------------- ------------------------------------ - ExampleSoft 95842091-725a-8501-ef29-0472985982be 1 # prodreg info -u EXSOzzt -i 1 -a "Dependent Components" Dependent Components: Name UUID # --------------------------- ------------------------------------ - ExampleSoft 95842091-725a-8501-ef29-0472985982be 1 # prodreg info -u EXSOblob -i 1 -a "Dependent Components" Dependent Components: Name UUID # --------------------------- ------------------------------------ - Example Data EXSOzzt 1 # prodreg unregister -r -u 95842091-725a-8501-ef29-0472985982be -i 1
    3 重新安装一个软件组件的步骤

    如果其他软件依赖遭到破坏的软件组件,您可能希望重新安装遭到破坏的组件,而不是卸载该组件和依赖它的软件。可以使用带有 -f 选项的 prodreg unregister 命令来强制注销遭到破坏的组件,然后重新安装该组件。步骤如下:

 成为超级用户或承担等效角色。
 查看有关要重新安装的软件的信息。
    # prodreg browse -m "name"
 标识依赖要重新安装的软件的软件。
    # prodreg info -m "name" -a "Dependent Components"
 注销要重新安装的软件组件。
    # prodreg unregister -f -u UUID

 重新安装该软件组件。

     # /usr/bin/java -cp /usr/installers/installer
     installer 选项指定 name 软件的安装程序的名称。

    4 应用实例

    下面的例子演示如何重新安装遭到破坏的软件组件 ComponentSoft,而不注销或卸载依赖组件 ExampleSoft。

# prodreg browse -m "ComponentSoft" BROWSE # +/-/. UUID # NAME ======== ===== ==================================== = ============ 1 - root 1 System Registry 2 + a01ee8dd-1dd1-11b2-a3f2-0800209a5b6b 1 Solaris 10 System Software 3 + 8f64eabf-1dd2-11b2-a3f1-0800209a5b6b 1 Unclassified Software 4 . 86758449-554a-6531-fe90-4352678362fe 1 ComponentSoft # prodreg info -m "ComponentSoft" -a "Dependent Components" Dependent Components: Name UUID # --------------------------- ------------------------------------ - ExampleSoft 95842091-725a-8501-ef29-0472985982be 1 # prodreg unregister -f -u 86758449-554a-6531-fe90-4352678362fe -i 1 # /usr/bin/java -cp /usr/installers/org.example.componentsoft
总结:本文介绍了使用命令行方式使用Product Registry的方法,当然还可以使用使用包管理命令(pkginfo、pkgadd)来管理软件,后边笔者会进行介绍。
0
相关文章