Chinaunix首页 | 论坛 | 博客
  • 博客访问: 596723
  • 博文数量: 118
  • 博客积分: 2114
  • 博客等级: 大尉
  • 技术积分: 1275
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-10 00:02
文章分类

全部博文(118)

文章存档

2019年(1)

2018年(4)

2017年(1)

2016年(6)

2015年(1)

2014年(1)

2013年(5)

2012年(4)

2011年(17)

2010年(13)

2009年(65)

分类:

2009-03-17 16:11:33

1. pkgutil tools for Solaris and Open Solaris

installation pkgutil application, you can refer to the file attached too.
for X86 platform:
pkgadd -d

for Sparc platform:
pkgadd -d

bash-3.00# pkgadd -d

## Downloading...
..............25%..............50%..............75%..............100%
## Download Complete


The following packages are available:
  1  CSWpkgutil     pkgutil - installs Solaris packages easily
                    (sparc) 1.4,REV=2009.01.20

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]:

Processing package instance from <>

pkgutil - installs Solaris packages easily(sparc) 1.4,REV=2009.01.20

Please see /opt/csw/share/doc/pkgutil/LICENSE for license information.

## Processing package information.
## Processing system information.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

This package contains scripts which will be executed with super-user
permission during the process of installing this package.

Do you want to continue with the installation of [y,n,?] y

Installing pkgutil - installs Solaris packages easily as

## Installing part 1 of 1.
/opt/csw/bin/bldcat
/opt/csw/bin/chkcat
/opt/csw/bin/pkgutil
/opt/csw/etc/pkgutil.conf.CSW
/opt/csw/libexec/pkgutil/wget
/opt/csw/share/doc/pkgutil/LICENSE
/opt/csw/share/doc/pkgutil/readme
/opt/csw/share/man/man1/pkgutil.1
/var/opt/csw/pkgutil/admin.CSW
[ verifying class ]
## Executing postinstall script.


Installation of was successful.



文件: pkgutility.tar.gz
大小: 218KB
下载: 下载


bash-3.00# /opt/csw/bin/pkgutil   
Pkgutil 1.4, install Solaris packages the easy way.

Usage: pkgutil [option]... [package]...

  -i, --install                           Install package
  -u, --upgrade                     Upgrade package
  -r, --remove                       Remove package
  -d, --download                   Download only
  -a, --available                    Show available packages
  -c, --compare                     Compare installed packages to current
  -U, --catalog                      Update catalog
  -e, --email=address         Send e-mail with available updates
  -t, --temp=site                  Temporarily use this site as primary for download
  -s, --stream                       Build a package stream
  -T, --target=arch:rel         Specify architecture and OS release for stream
  -o, --output=file                File name for package stream (used with -s)
  -x, --exclude=package     Package to exclude
  -W, --workdir=path          Path to use for downloads
  -y, --yes                             Answer yes on all prompts
  -n, --nomod                       No modifications are made to the system
  -D, --debug                       Debug mode
  -h, --help                           Show this help
  -v, --version                      Show version
  -V, --syscheck                   System check

Example: pkgutil -i CSWwget (install wget and its dependencies)

Written and maintained by Peter Bonivart.

 

 

用 pkgadd 裝軟體最大的問題就是相依性,常常要一個一個將相依的套件裝上。後來發現有個 pkg-get tool 可以將所有相依的軟體通通裝上,就像是 Debian 上 的apt-get,這樣裝軟體就省事許多;不過最近在 opensolais上 想要用 pkg-get 時才知道已經 pkgutil 取代,但兩者用起來差異不大,紀錄一下怎麼使用(solaris 10)。

首先,先裝好pkgutil tool(i386)

# wget
# pkgadd -d pkgutil_i386.pkg

pkgutil 裝好會出現大概提供了三樣工具:

/opt/csw/bin/bldcat
/opt/csw/bin/chkcat
/opt/csw/bin/pkgutil

因為透過pkgutil裝得軟體都會放在/opt/csw位置,好處是不會跟系統上的軟體搞混,但麻煩的就是要手動設一堆路徑。

update:後來發現把環境變數通通加到/etc/profile是很不好的作法,因為每個使用者shell不一定相同,變數設定方法也不同

修改/etc/bashrc,加入:

export PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/ccs/bin:/usr
/local/SUNWspro/bin:/sbin:/usr/openwin/bin:/usr/dt/bin:/opt/csw/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib:/usr/local/SUNWspro/lib:/usr/local/lib:/usr/ucb/lib:/lib
export MANPATH=$MANPATH:/opt/csw/man:/opt/csw/share/man

因為抓 pkg 要到國外的實在太慢了,就改 pkgutil 設定從國內站抓。

#cp -p /opt/csw/etc/pkgutil.conf.CSW /etc/opt/csw/pkgutil.conf

修改 /etc/opt/csw/pkgutil.conf,修改 mirror site:

mirror=http://ftp.cs.pu.edu.tw/pub/Sun/opencsw/current

大致上就完成,下面是幾個常用的指令:

  • 更新套件清單
    /opt/csw/bin/pkgutil -U
  • 可用套件清單
    /opt/csw/bin/pkgutil -a
  • 安裝套件
    /opt/csw/bin/pkgutil -i [name]
  • 升級套件
    /opt/csw/bin/pkgutil -u [name]
  • 檢查套件是否有新版
    /opt/csw/bin/pkgutil -c



阅读(1494) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2009-03-21 22:18:26

这不就是csw推的pkg-get吗?怎么有包了一层?