Managing Solaris Packages
MANAGING SOLARIS PACKAGES.
I have been asked several times “how do I find out which packages are installed in my box” well, the answer is using the pkginfo command.
# pkginfo | more
system CADP160 Adaptec Ultra160 SCSI Host Adapter Driver
system HPFC Agilent Fibre Channel HBA Driver
system NCRos86r NCR Platform Support, OS Functionality (Root)
system SK98sol SysKonnect SK-NET Gigabit Ethernet Adapter SK-98xx
system SKfp SysKonnect PCI-FDDI Host Adapter
application SMCbind bind
application SMCgcc gcc
application SMCiconv libiconv
application SMCncurs ncurses
application SMCosslg openssl
application SMCpopt popt
application SMCreadl readline
application SMCsamba samba
…
As you can see the more option give you a list of everything that is install in a screen by screen basic. If you type the pkginfo command by itself, you probably won’t b able to see each one of the package that is install as the list runs by so fast. Now let’s said we want to find out information about a specific package that is already install in our system as an example I will pick SMCsamba.
# pkginfo -l SMCsamba
PKGINST: SMCsamba
NAME: samba
CATEGORY: application
ARCH: intel
VERSION: 3.0.10
BASEDIR: /usr/local/samba
VENDOR: The Samba Group
PSTAMP: Steve Christensen
INSTDATE: Nov 30 2005 22:29
EMAIL: steve@smc.vnet.net
STATUS: completely installed
FILES: 1171 installed pathnames
79 directories
41 executables
104086 blocks used (approx)
You can also determine how many packages are install in your system by issuing the following command:
# pkginfo | wc -l
925
In my case it showing that I have 925 ( a lot). In your case might be more or less depending in what you have installed/removed after OS installation. If we were to add new packages to the things will be a little different, we will use the following to accomplish such:
# pkgadd -d <pkgname>
The above step is performed to install a package that has been downloaded locally. If you want to install a package from a remote location you would use something very similar to this:
# pkgadd -d http://URL/packages/SUNWrsc.pkg all
Similarly to pkgadd to add new packages there is another utility to check the integrity or components of a package, the utility is call pkgchk and it is use in the following format.
# pkgchk –v SUNWladm
The –v option allows you to see the files that are contained within the software.
Another of the command use is the pkgrm command and this one is use to remove package that has been install in the system. In this particular instance I have to emphasize to be very cautious of the dependency warnings you will received when removing a package. The system will allow you to remove the package though the package may be required by another package.
# pkgrm SUNWapchr
The following package is currently installed:
SUNWapchr Apache Web Server (root)
(sparc) 11.10.0,REV=2004.08.20.02.37
Do you want to remove this package? [y,n,?,q] y
## Removing installed package instance <SUNWapchr>
## Verifying package dependencies.
WARNING:
The <SUNWapchu> package depends on the package
currently being removed.
WARNING:
The <SUNWapchd> package depends on the package
currently being removed.
WARNING:
The <SUNWipplr> package depends on the package
currently being removed.
WARNING:
The <SUNWserweb> package depends on the package
currently being removed.
Dependency checking failed.
Do you want to continue with the removal of this package [y,n,?,q] y
## Processing package information.
## Removing pathnames in class <initd>
/etc/rcS.d/K16apache
/etc/rc3.d/S50apache
/etc/rc2.d/K16apache
(output ommited for brevity)
/etc/apache/httpd.conf-example
/etc/apache/README.Solaris
/etc/apache <shared pathname not removed>
/etc <shared pathname not removed>
## Updating system information.
Removal of <SUNWapchr> was successful.
Sometimes I think is very convenient to copy package from the Solaris 10 CDROM into what is call the spool directory (/var/spool/pkg), this method allows you to install the packages you use more frequently in a easier way. To copy packages from the solaris 10 CDROM into the spool directory we do the following:
# pkgadd -d /cdrom/cdrom0/s0/Solaris_10/Product -s spool SUNWauda
Transferring <SUNWauda> package instance
In the above scenario I am coping the SUNWauda package into the spool, you can do the same for all the packages you most frequently use. Now let’s check that the package was transfer to the spool using the ls –al command into that directory as follow:
# ls -al /var/spool/pkg
total 6
drwxrwxrwt 3 root bin 512 Oct 1 14:26 .
drwxr-xr-x 12 root bin 512 Sep 30 20:03 ..
drwxrwxr-x 5 root root 512 Oct 1 14:26 SUNWauda
After adding all the packages you want, installing them becomes easier, in this particular example I will install the package I just transfer to the spool which is SUNWauda doing the following:
# pkgadd SUNWauda
You can always remove software package from the spool that you will not longer use using:
# pkgrm -s spool SUNWauda
The following package is currently spooled:
SUNWauda Audio Applications
(sparc) 11.10.0,REV=2004.09.03.08.15
Do you want to remove this package? [y,n,?,q] y
Removing spooled package instance <SUNWauda>
We are not force to use the spool (/var/spool/pkg); however, Solaris 10 uses that one as the default directory for spooling. If you want to define your own spooling directory you can do so doing the following.
# pkgadd -d /cdrom/cdrom0/s0/Solaris_10/Product -s /export/pkg SUNWauda
# pkgrm -s /export/pkg SUNWauda
As you can see I have define my spooling directory as /export/pkg rather than the default one.
Hopefully this gives you a brief idea about package management. As you practice the various commands you will become more familiar with installation and deletion of your packages. I want to thanks the opensolaris community at IRC who has help me in so many ways to continue learning the OS.
I have been asked several times “how do I find out which packages are installed in my box” well, the answer is using the pkginfo command.
# pkginfo | more
system CADP160 Adaptec Ultra160 SCSI Host Adapter Driver
system HPFC Agilent Fibre Channel HBA Driver
system NCRos86r NCR Platform Support, OS Functionality (Root)
system SK98sol SysKonnect SK-NET Gigabit Ethernet Adapter SK-98xx
system SKfp SysKonnect PCI-FDDI Host Adapter
application SMCbind bind
application SMCgcc gcc
application SMCiconv libiconv
application SMCncurs ncurses
application SMCosslg openssl
application SMCpopt popt
application SMCreadl readline
application SMCsamba samba
…
As you can see the more option give you a list of everything that is install in a screen by screen basic. If you type the pkginfo command by itself, you probably won’t b able to see each one of the package that is install as the list runs by so fast. Now let’s said we want to find out information about a specific package that is already install in our system as an example I will pick SMCsamba.
# pkginfo -l SMCsamba
PKGINST: SMCsamba
NAME: samba
CATEGORY: application
ARCH: intel
VERSION: 3.0.10
BASEDIR: /usr/local/samba
VENDOR: The Samba Group
PSTAMP: Steve Christensen
INSTDATE: Nov 30 2005 22:29
EMAIL: steve@smc.vnet.net
STATUS: completely installed
FILES: 1171 installed pathnames
79 directories
41 executables
104086 blocks used (approx)
You can also determine how many packages are install in your system by issuing the following command:
# pkginfo | wc -l
925
In my case it showing that I have 925 ( a lot). In your case might be more or less depending in what you have installed/removed after OS installation. If we were to add new packages to the things will be a little different, we will use the following to accomplish such:
# pkgadd -d <pkgname>
The above step is performed to install a package that has been downloaded locally. If you want to install a package from a remote location you would use something very similar to this:
# pkgadd -d http://URL/packages/SUNWrsc.pkg all
Similarly to pkgadd to add new packages there is another utility to check the integrity or components of a package, the utility is call pkgchk and it is use in the following format.
# pkgchk –v SUNWladm
The –v option allows you to see the files that are contained within the software.
Another of the command use is the pkgrm command and this one is use to remove package that has been install in the system. In this particular instance I have to emphasize to be very cautious of the dependency warnings you will received when removing a package. The system will allow you to remove the package though the package may be required by another package.
# pkgrm SUNWapchr
The following package is currently installed:
SUNWapchr Apache Web Server (root)
(sparc) 11.10.0,REV=2004.08.20.02.37
Do you want to remove this package? [y,n,?,q] y
## Removing installed package instance <SUNWapchr>
## Verifying package dependencies.
WARNING:
The <SUNWapchu> package depends on the package
currently being removed.
WARNING:
The <SUNWapchd> package depends on the package
currently being removed.
WARNING:
The <SUNWipplr> package depends on the package
currently being removed.
WARNING:
The <SUNWserweb> package depends on the package
currently being removed.
Dependency checking failed.
Do you want to continue with the removal of this package [y,n,?,q] y
## Processing package information.
## Removing pathnames in class <initd>
/etc/rcS.d/K16apache
/etc/rc3.d/S50apache
/etc/rc2.d/K16apache
(output ommited for brevity)
/etc/apache/httpd.conf-example
/etc/apache/README.Solaris
/etc/apache <shared pathname not removed>
/etc <shared pathname not removed>
## Updating system information.
Removal of <SUNWapchr> was successful.
Sometimes I think is very convenient to copy package from the Solaris 10 CDROM into what is call the spool directory (/var/spool/pkg), this method allows you to install the packages you use more frequently in a easier way. To copy packages from the solaris 10 CDROM into the spool directory we do the following:
# pkgadd -d /cdrom/cdrom0/s0/Solaris_10/Product -s spool SUNWauda
Transferring <SUNWauda> package instance
In the above scenario I am coping the SUNWauda package into the spool, you can do the same for all the packages you most frequently use. Now let’s check that the package was transfer to the spool using the ls –al command into that directory as follow:
# ls -al /var/spool/pkg
total 6
drwxrwxrwt 3 root bin 512 Oct 1 14:26 .
drwxr-xr-x 12 root bin 512 Sep 30 20:03 ..
drwxrwxr-x 5 root root 512 Oct 1 14:26 SUNWauda
After adding all the packages you want, installing them becomes easier, in this particular example I will install the package I just transfer to the spool which is SUNWauda doing the following:
# pkgadd SUNWauda
You can always remove software package from the spool that you will not longer use using:
# pkgrm -s spool SUNWauda
The following package is currently spooled:
SUNWauda Audio Applications
(sparc) 11.10.0,REV=2004.09.03.08.15
Do you want to remove this package? [y,n,?,q] y
Removing spooled package instance <SUNWauda>
We are not force to use the spool (/var/spool/pkg); however, Solaris 10 uses that one as the default directory for spooling. If you want to define your own spooling directory you can do so doing the following.
# pkgadd -d /cdrom/cdrom0/s0/Solaris_10/Product -s /export/pkg SUNWauda
# pkgrm -s /export/pkg SUNWauda
As you can see I have define my spooling directory as /export/pkg rather than the default one.
Hopefully this gives you a brief idea about package management. As you practice the various commands you will become more familiar with installation and deletion of your packages. I want to thanks the opensolaris community at IRC who has help me in so many ways to continue learning the OS.

0 Comments:
Post a Comment
<< Home