Objectives : Master Solaris 11 administration tasks.
Who can benefit : Oracle 10 System Administrators.
Prerequisites : Extensive experience in administering a Solaris 10 system.
Learning technique : Clear, theoretical course content divided into lessons and extensive LABS available on-line 24/24 7/7.
Student Progression : Student progression is monitored both in terms of effective course duration and in terms of student comprehension using self-assessment tests.
Operating Systems covered by this course : Oracle Solaris 11.
…
Although still present as shown above, use of the Solaris 10 package management commands has been replaced in Solaris 11 by the Solaris Image Packaging System.
Solaris 11 uses the new Image Packaging System technology combined with the Service Management Facility ( SMF ), the Zettabyte File System ( ZFS ) technologies to greatly simplify both package management and patch management.
The IPS pkg command and its subcommands work much like their Linux counterparts yum, apt-get and zypper, relying on a repository which contains available packages.
The pkg subcommands are as follows:
Subcommand | Description |
---|---|
publisher | Lists current and disabled repositories “published” by publishers |
set-publisher | Adds a publisher |
unset-publisher | Removes a publisher |
list | Lists installed packages |
search | Searches for a package in the system's active publishers and returns the first match found |
install | Installs/Updates packages |
uninstall | Uninstalls packages |
refresh | Updates the cached list of available packages |
update | Updates all or certain packages to their latest versions |
info | Displays information about packages |
contents | Displays files installed by a package |
verify | Validates the installation and digital signature packages |
history | Displays the pkg history |
help | Lists the above and advanced subcommands and their switches |
Firstly, check which publishers are installed on the system:
root@solaris:~# pkg publisher PUBLISHER TYPE STATUS P LOCATION solaris origin online F http://pkg.oracle.com/solaris/release/
You can display additional information about a publisher as follows:
root@solaris:~# pkg publisher solaris Publisher: solaris Alias: Origin URI: http://pkg.oracle.com/solaris/release/ SSL Key: None SSL Cert: None Client UUID: ddee2130-0292-11e2-b9e5-80144f013e20 Catalog Updated: October 16, 2012 09:25:04 PM Enabled: Yes
Now add the OpenIndiana publisher:
root@solaris:~# pkg set-publisher -g http://pkg.openindiana.org/sfe sfe root@solaris:~# pkg publisher PUBLISHER TYPE STATUS P LOCATION solaris origin online F http://pkg.oracle.com/solaris/release/ sfe origin online F http://pkg.openindiana.org/sfe/
To understand the use of the -g switch, use the built-in help function:
root@solaris:~# pkg help set-publisher Usage: pkg set-publisher [-Ped] [-k ssl_key] [-c ssl_cert] [-g origin_to_add|--add-origin=origin_to_add ...] [-G origin_to_remove|--remove-origin=origin_to_remove ...] [-m mirror_to_add|--add-mirror=mirror_to_add ...] [-M mirror_to_remove|--remove-mirror=mirror_to_remove ...] [-p repo_uri] [--enable] [--disable] [--no-refresh] [--reset-uuid] [--non-sticky] [--sticky] [--search-after=publisher] [--search-before=publisher] [--search-first] [--approve-ca-cert=path_to_CA] [--revoke-ca-cert=hash_of_CA_to_revoke] [--unset-ca-cert=hash_of_CA_to_unset] [--set-property name_of_property=value] [--add-property-value name_of_property=value_to_add] [--remove-property-value name_of_property=value_to_remove] [--unset-property name_of_property_to_delete] [--proxy proxy to use] [publisher]
Display additional information about the publisher:
root@solaris:~# pkg publisher sfe Publisher: sfe Alias: Origin URI: http://pkg.openindiana.org/sfe/ SSL Key: None SSL Cert: None Client UUID: e873ddf6-3fba-11e2-8b21-880027ed6b01 Catalog Updated: December 5, 2012 08:40:30 PM Enabled: Yes
Now remove the OpenIndiana publisher:
root@solaris:~# pkg unset-publisher sfe root@solaris:~# pkg publisher PUBLISHER TYPE STATUS P LOCATION solaris origin online F http://pkg.oracle.com/solaris/release/
List all available packages on the system:
root@solaris:~# pkg list | more NAME (PUBLISHER) VERSION IFO archiver/gnu-tar 1.26-0.175.1.0.0.24.0 i-- audio/audio-utilities 0.5.11-0.175.1.0.0.24.2 i-- codec/flac 1.2.1-0.175.0.0.0.0.0 i-- codec/libtheora 1.1.1-0.175.1.0.0.15.0 i-- codec/ogg-vorbis 2.30.0-0.175.1.0.0.12.0 i-- codec/speex 1.2-0.175.1.0.0.15.0 i-- communication/im/pidgin 2.10.5-0.175.1.0.0.24.0 i-- compress/bzip2 1.0.6-0.175.1.0.0.24.0 i-- compress/gzip 1.4-0.175.1.0.0.24.0 i-- compress/p7zip 9.20.1-0.175.1.0.0.24.0 i-- compress/unzip 6.0-0.175.1.0.0.24.0 i-- compress/xz 5.0.1-0.175.1.0.0.24.0 i-- compress/zip 3.0-0.175.1.0.0.24.0 i-- consolidation/SunVTS/SunVTS-incorporation 0.5.11-0.175.1.0.0.14.0 i-- consolidation/X/X-incorporation 0.5.11-0.175.1.0.0.24.1317 i-- consolidation/admin/admin-incorporation 0.5.11-0.175.1.0.0.5.0 i-- consolidation/cacao/cacao-incorporation 0.5.11-0.175.1.0.0.11.0 i-- consolidation/cde/cde-incorporation 0.5.11-0.175.0.0.0.0.0 i-- consolidation/cns/cns-incorporation 0.5.11-0.175.1.0.0.23.0 i-- consolidation/dbtg/dbtg-incorporation 0.5.11-0.175.1.0.0.15.0 i-- consolidation/desktop/desktop-incorporation 0.5.11-0.175.1.0.0.24.2 i-- consolidation/desktop/gnome-incorporation 0.5.11-0.175.1.0.0.22.0 i-- consolidation/gfx/gfx-incorporation 0.5.11-0.175.1.0.0.5.0 i-- consolidation/install/install-incorporation 0.5.11-0.175.1.0.0.24.1736 i-- consolidation/ips/ips-incorporation 0.5.11-0.175.1.0.0.24.0 i-- consolidation/java/java-incorporation 0.5.11-0.175.1.0.0.24.0 i-- consolidation/jdmk/jdmk-incorporation 0.5.11-0.173.0.0.0.0.0 i-- consolidation/l10n/l10n-incorporation 0.5.11-0.175.1.0.0.23.1134 i-- consolidation/man/man-incorporation 0.5.11-0.175.1.0.0.21.0 i-- consolidation/nspg/nspg-incorporation 0.5.11-0.175.1.0.0.5.0 i-- consolidation/nvidia/nvidia-incorporation 0.5.11-0.175.1.0.0.22.0 i-- consolidation/osnet/osnet-incorporation 0.5.11-0.175.1.0.0.24.2 i-- consolidation/sfw/sfw-incorporation 0.5.11-0.175.1.0.0.5.0 i-- consolidation/sic_team/sic_team-incorporation 0.5.11-0.175.1.0.0.5.0 i-- consolidation/solaris_re/solaris_re-incorporation 0.5.11-0.175.1.0.0.24.3 i-- consolidation/sunpro/sunpro-incorporation 0.5.11-0.175.1.0.0.19.0 i-- consolidation/ub_javavm/ub_javavm-incorporation 0.5.11-0.175.1.0.0.24.1 i-- consolidation/userland/userland-incorporation 0.5.11-0.175.1.0.0.24.0 i-- consolidation/vpanels/vpanels-incorporation 0.5.11-0.175.1.0.0.17.0 i-r consolidation/xvm/xvm-incorporation 0.5.11-0.175.1.0.0.5.0 i-- crypto/ca-certificates 0.5.11-0.175.1.0.0.24.2 i--
Note the IFO column:
Letter | Description |
---|---|
i | The package is installed |
f | The package is frozen and cannot be updated |
o | The package is obsolete |
To understand the r in the third column of the vpanels-incorporation package, use the info subcommand:
root@solaris:~# pkg info vpanels-incorporation Name: consolidation/vpanels/vpanels-incorporation Summary: State: Installed (Renamed) Renamed to: pkg:/consolidation/userland/userland-incorporation pkg:/consolidation/osnet/osnet-incorporation Publisher: solaris Version: 0.5.11 Build Release: 5.11 Branch: 0.175.1.0.0.17.0 Packaging Date: May 29, 2012 10:02:23 PM Size: 5.46 kB FMRI: pkg://solaris/consolidation/vpanels/vpanels-incorporation@0.5.11,5.11-0.175.1.0.0.17.0:20120529T220223Z
Use the list subcommand to easily identify the package version number of a single package:
root@solaris:~# pkg list vpanels-incorporation NAME (PUBLISHER) VERSION IFO consolidation/vpanels/vpanels-incorporation 0.5.11-0.175.1.0.0.17.0 i-r
To identify the package creation timestamp, use the -v switch of the list subcommand:
root@solaris:~# pkg list -v vpanels-incorporation FMRI IFO pkg://solaris/consolidation/vpanels/vpanels-incorporation@0.5.11,5.11-0.175.1.0.0.17.0:20120529T220223Z i-r
The output of this command shows a line of the following format:
FMRI Scheme://Publisher/Package Name@Version,Build Release-Branch:Package Creation Timestamp IFO
The name FMRI means Fault Managed Resource Identifier. FMRIs are covered in the Service Administration lesson of this course.
Wildcards can be used to list packages available, either installed or not:
root@solaris:~# pkg list -a compress* NAME (PUBLISHER) VERSION IFO compress/bzip2 1.0.6-0.175.1.0.0.24.0 i-- compress/gzip 1.4-0.175.1.0.0.24.0 i-- compress/lcab (sfe) 1.0.12-0.151.1.5 --- compress/lcab/src (sfe) 1.0.12-0.151.1.5 --- compress/lha (sfe) 1.14.9.1-0.151.1.5 --- compress/lha/src (sfe) 1.14.9.1-0.151.1.5 --- compress/p7zip 9.20.1-0.175.1.0.0.24.0 i-- compress/unzip 6.0-0.175.1.0.0.24.0 i-- compress/unzoo (sfe) 4.4-0.151.1.5 --- compress/unzoo/src (sfe) 4.4-0.151.1.5 --- compress/xz 5.0.1-0.175.1.0.0.24.0 i-- compress/zip 3.0-0.175.1.0.0.24.0 i--
To display the number of installed packages, use the following command:
root@solaris:~# pkg list | wc -l 873
To display the number of installed and available packages, use the -a switch:
root@solaris:~# pkg list -a | wc -l 2615
You are now going to install the ClamAV anti-virus package. This package is available from the OpenIndiana publisher. In order to use that publisher you need to add it once more:
root@solaris:~# pkg set-publisher -g http://pkg.openindiana.org/sfe sfe root@solaris:~# pkg publisher PUBLISHER TYPE STATUS P LOCATION solaris origin online F http://pkg.oracle.com/solaris/release/ sfe origin online F http://pkg.openindiana.org/sfe/
There are two ways to identify the package name before being able to install it, either by using the list subcommand:
root@solaris:~# pkg list -a | grep clamav antivirus/clamav (sfe) 0.97.6-0.151.1.6 --- antivirus/clamav/src (sfe) 0.97.6-0.151.1.6 --- security/clamav (sfe) 0.97.3-0.151.1 --r
or, alternatively by using the search subcommand:
root@solaris:~# pkg search antivirus/clamav INDEX ACTION VALUE PACKAGE require depend pkg:/antivirus/clamav@0.97.5,5.11-0.151.1.5 pkg:/security/clamav@0.97.3-0.151.1 pkg.fmri set sfe/antivirus/clamav pkg:/antivirus/clamav@0.97.5-0.151.1.5
Installing ClamAV is now very simple:
root@solaris:~# pkg install antivirus/clamav Packages to install: 3 Create boot environment: No Create backup boot environment: No DOWNLOAD PKGS FILES XFER (MB) SPEED Completed 3/3 55/55 1.7/1.7 458k/s PHASE ITEMS Installing new actions 110/110 Updating package state database Done Updating image state Done Creating fast lookup database Done
To check whether the package is now installed, use the list subcommand:
root@solaris:~# pkg list clamav NAME (PUBLISHER) VERSION IFO antivirus/clamav (sfe) 0.97.6-0.151.1.6 i--
or the verify subcommand:
root@solaris:~# pkg verify -v clamav PACKAGE STATUS pkg://sfe/antivirus/clamav OK
Remember that for more information about the installed package, you can use the info subcommand:
root@solaris:~# pkg info clamav Name: antivirus/clamav Summary: Unix anti-virus scanner Category: Applications/System Utilities State: Installed Publisher: sfe Version: 0.97.6 Build Release: 5.11 Branch: 0.151.1.6 Packaging Date: October 1, 2012 08:13:32 PM Size: 3.95 MB FMRI: pkg://sfe/antivirus/clamav@0.97.6,5.11-0.151.1.6:20121001T201332Z
By using the which command, you will notice that there is no clamav program in /bin or /usr/bin:
root@solaris:~# which clamav no clamav in /usr/bin /usr/sbin
So, either the program is not called clamav or it is elsewhere in the filesystem. In order to see which files the package installed, use the contents subcommand:
root@solaris:~# pkg contents antivirus/clamav PATH etc etc/clamav-milter.conf etc/clamd.conf etc/freshclam.conf usr usr/bin usr/bin/clamav-config usr/bin/clambc usr/bin/clamconf usr/bin/clamdscan usr/bin/clamdtop usr/bin/clamscan usr/bin/freshclam usr/bin/sigtool usr/include usr/include/clamav.h usr/lib usr/lib/libclamav.so usr/lib/libclamav.so.6 usr/lib/libclamav.so.6.1.15 usr/lib/libclamunrar.so usr/lib/libclamunrar.so.6 usr/lib/libclamunrar.so.6.1.15 usr/lib/libclamunrar_iface.so usr/lib/libclamunrar_iface.so.6 usr/lib/libclamunrar_iface.so.6.1.15 usr/lib/pkgconfig usr/lib/pkgconfig/libclamav.pc usr/sbin usr/sbin/clamav-milter usr/sbin/clamd usr/share usr/share/doc usr/share/doc/clamav usr/share/doc/clamav/COPYING usr/share/doc/clamav/COPYING.LGPL usr/share/doc/clamav/COPYING.bzip2 usr/share/doc/clamav/COPYING.file usr/share/doc/clamav/COPYING.getopt usr/share/doc/clamav/COPYING.llvm usr/share/doc/clamav/COPYING.lzma usr/share/doc/clamav/COPYING.regex usr/share/doc/clamav/COPYING.sha256 usr/share/doc/clamav/COPYING.unrar usr/share/doc/clamav/COPYING.zlib usr/share/doc/clamav/ChangeLog usr/share/doc/clamav/FAQ usr/share/doc/clamav/README usr/share/doc/clamav/clamav-mirror-howto.pdf usr/share/doc/clamav/clamdoc.pdf usr/share/doc/clamav/phishsigs_howto.pdf usr/share/doc/clamav/signatures.pdf usr/share/man usr/share/man/man1 usr/share/man/man1/clambc.1 usr/share/man/man1/clamconf.1 usr/share/man/man1/clamdscan.1 usr/share/man/man1/clamdtop.1 usr/share/man/man1/clamscan.1 usr/share/man/man1/freshclam.1 usr/share/man/man1/sigtool.1 usr/share/man/man5 usr/share/man/man5/clamav-milter.conf.5 usr/share/man/man5/clamd.conf.5 usr/share/man/man5/freshclam.conf.5 usr/share/man/man8 usr/share/man/man8/clamav-milter.8 usr/share/man/man8/clamd.8 var var/clamav
As you can see, the package installed the following programs:
usr/bin/clamav-config usr/bin/clambc usr/bin/clamconf usr/bin/clamdscan usr/bin/clamdtop usr/bin/clamscan usr/bin/freshclam usr/bin/sigtool usr/sbin/clamav-milter usr/sbin/clamd
Uninstalling the package is now as simple as installing it:
root@solaris:~# pkg uninstall clamav Packages to remove: 3 Create boot environment: No Create backup boot environment: No PHASE ITEMS Removing old actions 101/101 Updating package state database Done Updating package cache 3/3 Updating image state Done Creating fast lookup database Done
The uninstall subcommand removes all files installed by a package, except those that are dependencies of another installed package.
You can also search for a package that contains a specific program:
root@solaris:~# pkg search /usr/bin/clamdscan INDEX ACTION VALUE PACKAGE path file usr/bin/clamdscan pkg:/antivirus/clamav@0.97.5-0.151.1.5 path file usr/bin/clamdscan pkg:/security/clamav@0.97.3-0.151.1
The pkg command can also be used to update installed packages:
root@solaris:~# pkg update No updates available for this image.
If you wish to update a specific package to the latest available version, use the following syntax : pkg update package@latest.
…
<html>
Copyright © 2004-2017 Hugh Norris.<br><br> <a rel=“license” href=“http://creativecommons.org/licenses/by-nc-nd/3.0/”><img alt=“Creative Commons License” style=“border-width:0” src=“http://i.creativecommons.org/l/by-nc-nd/3.0/88x31.png” /></a><br />This work is licensed under a <a rel=“license” href=“http://creativecommons.org/licenses/by-nc-nd/3.0/”>Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License</a>.
</html>