Solaris Admin Series, part 16. Previous: Installing Solaris 10 on x86. Related: part 14, Installing Solaris 10 on SPARC (where the software group screen first appears), part 3, Solaris Filesystem Layout Tour (what lives under /var/sadm), part 8, The Solaris PATH Problem (why /usr/sfw and /usr/ccs may be empty on a small install) and part 9, Solaris Text Editors on a Bare System (surviving on a minimal system). Next up: creating a sysidcfg file for hands-off system identification.
Every Solaris 10 installation asks you to pick a software group: a predefined set of SVR4 packages ranging from a bare text-console system to everything on the DVD plus extra drivers. The choice decides how much disk you use, how many packages you have to patch for the life of the server, which services and setuid binaries exist to be attacked, and whether that one tool you need at 3 AM is there or not. This post explains the six groups, how they are built from clusters and packages, how to customize them during an interactive or JumpStart install, how to check what a running system has, and how to add or remove software afterwards without breaking dependencies, zones or patching.
Applies to: Oracle Solaris 10 (examples from 1/13, Update 11) on SPARC and x86. The groups and commands are the same on both platforms; only the package architecture differs. Solaris 11.4 replaced SVR4 software groups with IPS group packages, which are covered at the end of this post.
Prerequisites
- A Solaris 10 1/13 DVD or ISO (
sol-10-u11-ga-sparc-dvd.isoorsol-10-u11-ga-x86-dvd.iso) for the install and for adding packages later. Keep a copy on the network; you will need it again. - Root access (or the Software Installation rights profile) on the system you are checking or changing.
- A list of what the server must run: the applications, their documented OS package requirements, whether it will host zones, and whether a desktop or X11 clients are needed at all.
- Familiarity with the interactive installer from part 14, Installing Solaris 10 on SPARC, or part 15, Installing Solaris 10 on x86.
The six Solaris 10 software groups
The groups are nested: each one contains everything in the one below it plus more. The cluster name in the second column is what JumpStart profiles and the installed-system records use. Disk figures are Oracle’s recommendations for 1/13 and include room for swap, patches and some extra packages; the actual footprint is smaller.
| Software group | Cluster (metacluster) | What it adds | Recommended disk (1/13) |
|---|---|---|---|
| Reduced Network Support | SUNWCrnet | The minimum to boot and run a multiuser text console with admin utilities. Network interfaces are recognized but network services are not activated. | 3035 MB |
| Core System Support | SUNWCreq | The minimum to boot and run a networked system: networking, NFS client, name service clients, basic remote access. | 3093 MB |
| End User | SUNWCuser | Core plus the Common Desktop Environment (CDE), X11 and Java Desktop System libraries and end-user tools. | 7074 MB |
| Developer | SUNWCprog | End User plus libraries, header files, man pages and programming tools. Compilers are not included (Oracle Solaris Studio is separate; the GCC 3.4 packages under /usr/sfw are on the media). | 8336 MB |
| Entire | SUNWCall | Developer plus server software: the full set of services, databases, web servers and utilities on the DVD. | 8529 MB |
| Entire Plus OEM Support | SUNWCXall | Entire plus extra hardware drivers, including drivers for hardware that is not present at install time. | 8575 MB |
Two consequences follow from the nesting. First, there is no “server without desktop” group between Core and Entire: End User is the first group that adds CDE and X11, and every larger group keeps them. Second, an upgrade keeps the group that is installed. You cannot upgrade an End User system into a Developer system; you can only add individual packages or clusters.
Groups, clusters and packages
The installer works with three levels:
- Packages (
SUNWcsr,SUNWsshdu,SUNWbtool…) are the SVR4 units thatpkgaddandpkgrmhandle. Many software features are split into a root part (…r, files under/etcand/var) and a usr part (…u, files under/usr). - Clusters (
SUNWCssh,SUNWCpm…) are named sets of related packages that the installer shows as one line you can expand. - Metaclusters are the six software groups themselves.
The definitions are in the .clustertoc file, on the media at Solaris_10/Product/.clustertoc and on an installed system at /var/sadm/system/admin/.clustertoc. Each entry names its members with SUNW_CSRMEMBER:
# grep -n '^METACLUSTER=' /var/sadm/system/admin/.clustertoc
1:METACLUSTER=SUNWCXall
...:METACLUSTER=SUNWCall
...:METACLUSTER=SUNWCprog
...:METACLUSTER=SUNWCuser
...:METACLUSTER=SUNWCreq
...:METACLUSTER=SUNWCrnet
# awk '/^METACLUSTER=SUNWCreq$/,/^END$/' /var/sadm/system/admin/.clustertoc | head -12
METACLUSTER=SUNWCreq
NAME=Core System Support
DESC=Contains the minimum software required to boot and run a networked Oracle Solaris system
VENDOR=Oracle Corporation
VERSION=2.5
SUNW_CSRMEMBER=SUNWCcs
SUNW_CSRMEMBER=SUNWCcsr
...
Sample output; the exact descriptions and order vary by update. A member can be a package or a cluster, so to expand a group completely you follow clusters recursively. This small script prints every package a group pulls in:
#!/bin/ksh
# expand-group.ksh SUNWCreq -> list of packages in a group or cluster
TOC=${TOC:-/var/sadm/system/admin/.clustertoc}
expand() {
for m in $(nawk -v c="$1" '
$0 == "METACLUSTER=" c || $0 == "CLUSTER=" c {on=1; next}
on && /^END$/ {exit}
on && /^SUNW_CSRMEMBER=/ {sub(/^SUNW_CSRMEMBER=/, ""); print}' "$TOC"); do
if egrep "^(META)?CLUSTER=$m\$" "$TOC" >/dev/null 2>&1; then expand "$m"; else echo "$m"; fi
done
}
expand "$1" | sort -u
# ./expand-group.ksh SUNWCreq | wc -l
...
# ./expand-group.ksh SUNWCuser | wc -l
...
Run it against the .clustertoc on your own media (TOC=/cdrom/cdrom0/Solaris_10/Product/.clustertoc) to compare groups before you install. Platform-specific packages appear in the list even if they do not apply to your hardware.
Choosing a group
| Use case | Sensible choice | Why |
|---|---|---|
| General-purpose production server, applications from vendors | SUNWCall or SUNWCXall | Fewest surprises with vendor prerequisites and Oracle support; disable services rather than removing packages. |
| x86 server, or SPARC with third-party cards | SUNWCXall | The OEM part carries drivers that the smaller groups lack. |
| Hardened single-purpose host (DNS, bastion, firewall, appliance) | SUNWCreq plus named packages | Small attack surface and patch footprint, but you own the list of extra packages. |
| Host that will run Oracle Database or other vendor software | Read the vendor guide first | Database installation guides list required packages (for example SUNWarc, SUNWbtool, SUNWhea, SUNWlibm, SUNWsprot, SUNWtoo) that the smallest groups do not contain. |
| Zone host | Generous (Entire or larger) | Non-global zones get their software from the global zone, as explained below. |
| Lab system for learning | SUNWCXall | Everything is there, including man pages and developer tools. |
SUNWCrnet is rarely the right answer for a server. It is meant as a base for heavily minimized builds where you add exactly what is needed, and many tools that administrators expect (remote access, NFS, name service tools) are not part of it. Check with pkginfo before assuming anything is present.
Step 1: Customizing the group during an interactive install
On the Select Software screen of the text installer (parts 14 and 15) you choose a group with the arrow keys and Space. Instead of continuing with Esc–2 (F2), press F4 (Customize) to change its contents:
- Customize Software -----------------------------------------------------
> [X] Apache Web Server ....................................... x.xx MB
> [/] Basic Networking Software ............................... x.xx MB
> [X] Secure Shell ............................................ x.xx MB
> [ ] Power Management Software ............................... x.xx MB
.
.
[X] = selected [/] = partially selected [ ] = not selected
> = expandable
Esc-2_OK F4_Expand F5_Cancel F6_Help
Sample screen; labels and sizes vary by update. Expand a cluster to select individual packages. [/] means some of its packages are selected. When you leave the screen, the installer checks dependencies and lists packages that depend on something you removed:
- Software Dependencies -------------------------------------------------
The software you selected has dependencies that are not satisfied.
...
F2_Continue F3_Go Back F4_Resolve Dependencies F5_Exit
Resolve dependencies here (add the required packages back) unless you have a specific reason not to. An unresolved dependency installs fine and then fails at run time, often in a way that does not mention the missing package. The final summary screen and /var/sadm/system/logs/install_log record what was actually installed.
Step 2: The same thing in a JumpStart profile
For repeatable builds, put the choice in a JumpStart profile. The first cluster line names the software group; later cluster and package lines add or delete clusters and packages. JumpStart itself gets its own posts later in the series; this is only the software part:
# minimal-core.profile (JumpStart profile, software section)
install_type initial_install
system_type standalone
pool rpool auto auto auto c0t0d0s0
cluster SUNWCreq
cluster SUNWCssh add
cluster SUNWCpm delete
package SUNWbtool add
package SUNWsprot add
package SUNWtoo add
package SUNWlibC add
locale en_US.UTF-8
cluster SUNWCreq(noaddordelete) selects the group. It must come before the add and delete lines.cluster name add|deleteandpackage name add|deleteadjust it.addis the default forpackage.- Deleting a package that is part of a required cluster or that something else depends on is not always honored; read the install log. Check the profile with
check(therulesvalidator) and test it withpfinstall -Dbefore using it on real hardware. - On a ZFS root profile the disk keyword is
pool; on UFS usepartitioningandfilesys.
# /usr/sbin/install.d/pfinstall -D -c /cdrom/cdrom0 minimal-core.profile
...
Installation complete
Test run complete. Exit status 0.
Step 3: Checking what is installed on a running system
The installed group is recorded in one file. It is written at install time and is not updated when you add or remove packages later:
# cat /var/sadm/system/admin/CLUSTER
CLUSTER=SUNWCreq
The real state is the package database. These are the commands you use most:
# pkginfo | wc -l # number of installed packages
# pkginfo -c system | head -5 # packages in a category
system SUNWaccr System Accounting, (Root)
system SUNWaccu System Accounting, (Usr)
...
# pkginfo -q SUNWbtool && echo installed || echo missing
missing
# pkginfo -l SUNWsshdu
PKGINST: SUNWsshdu
NAME: SSH Server, (Usr)
CATEGORY: system
ARCH: sparc
VERSION: 11.10.0,REV=2005.01.21.15.53
BASEDIR: /
VENDOR: Oracle Corporation
STATUS: completely installed
...
# pkgchk -l -p /usr/lib/ssh/sshd | grep -i package
Referenced by the following packages:
SUNWsshdu
Sample output. pkgchk -l -p answers “which package owns this file”, and STATUS: partially installed in pkginfo -l flags a broken package. Each package’s declared dependencies are in /var/sadm/pkg/<PKG>/install/depend (lines starting with P are prerequisites):
# cat /var/sadm/pkg/SUNWsshdu/install/depend
...
P SUNWcar Core Architecture, (Root)
P SUNWcsu Core Solaris, (Usr)
P SUNWsshcu SSH Common, (Usr)
P SUNWsshdr SSH Server, (Root)
...
To check whether a whole cluster is on the system, expand it with the script above and run pkginfo -q for each member.
Step 4: Adding missing packages later from the DVD
Sooner or later a minimized system needs something it does not have. Find the package on the media, add it with its dependencies, then patch it. Mount the DVD or ISO first:
# lofiadm -a /export/iso/sol-10-u11-ga-sparc-dvd.iso
/dev/lofi/1
# mount -F hsfs -o ro /dev/lofi/1 /mnt
# ls /mnt/Solaris_10/Product | wc -l
Each package directory has a pkgmap listing its files with paths relative to the base directory (no leading slash), so you can search for the file you are missing:
# grep -l ' usr/sfw/bin/gcc ' /mnt/Solaris_10/Product/*/pkgmap
/mnt/Solaris_10/Product/SUNWgcc/pkgmap
# grep '^P' /mnt/Solaris_10/Product/SUNWgcc/install/depend
Install the prerequisites the depend file lists first (or name them all on one command line; pkgadd installs them in the order given), then the package. An admin file avoids the interactive questions in scripts:
# cat /var/tmp/noask
mail=
instance=overwrite
partial=nocheck
runlevel=nocheck
idepend=nocheck
rdepend=nocheck
space=quit
setuid=nocheck
conflict=nocheck
action=nocheck
basedir=default
# pkgadd -a /var/tmp/noask -d /mnt/Solaris_10/Product SUNWbtool SUNWsprot
...
Installation of <SUNWbtool> was successful.
...
Installation of <SUNWsprot> was successful.
Keep idepend=nocheck only when you have checked dependencies yourself; with the default admin file, pkgadd warns about missing prerequisites and asks before continuing:
## Verifying package <SUNWgcc> dependencies in zone <global>
WARNING:
The <SUNWbinutils> package "binutils - GNU binutils" is a
prerequisite package and should be installed.
Do you want to continue with the installation of <SUNWgcc> [y,n,?]
Answer n, add the prerequisite and try again. Then patch the new packages: the DVD packages are at the 1/13 level, while the rest of the system may carry years of patches. Re-run the Recommended Patchset (its installpatchset only applies patches to packages that are installed), or apply the specific patches for the new packages, before putting the system back into service.
Step 5: Removing packages to minimize an installed system
Removing packages after the install is possible but needs more care than choosing a small group up front. pkgrm checks reverse dependencies and stops to ask:
# pkgrm SUNWsshdr
The following package is currently installed:
SUNWsshdr SSH Server, (Root)
(sparc) 11.10.0,REV=2005.01.21.15.53
Do you want to remove this package? [y,n,?,q] y
## Removing installed package instance <SUNWsshdr>
## Verifying package <SUNWsshdr> dependencies in zone <global>
WARNING:
The <SUNWsshdu> 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] n
- Remove dependents before the packages they depend on (here
SUNWsshdubeforeSUNWsshdr), and remove root and usr halves together. - There is no
pkgrmfor a cluster or a software group; expand the cluster and remove its member packages. TheCLUSTERfile still shows the original group afterwards. - Never remove anything from
SUNWCcs/SUNWCcsr(core Solaris) or packages the kernel, SMF or the boot archive need. A failed removal there can leave a system that does not boot. - Record every removal in your build notes. A future
pkgaddor patch may assume the package is present. - Prefer disabling to removing when the reason is only “the service should not run”:
svcadm disableis reversible, patch-safe and supported.
Minimizing for security: what it does and does not give you
Fewer packages means fewer setuid binaries, fewer daemons that could be enabled by mistake, fewer patches to track and a smaller root file system. It does not, on its own, turn off what is installed. Combine a sensible group with Secure by Default:
# netservices limited
...
# svcs -a | egrep 'telnet|rlogin|finger|ftp|rstat'
disabled 10:21:04 svc:/network/telnet:default
disabled 10:21:04 svc:/network/login:rlogin
...
# svcs -o state,fmri | grep online | wc -l
- Since Solaris 10 11/06, the installer can set the limited network services profile at install time (the network services question on the interactive screens, or
service_profile=limited_netinsysidcfg, covered in the next part). After the install,netservices limitedapplies the same profile andnetservices openreverts it. - With the limited profile, only
sshdlistens for remote connections; other services such as rpcbind, syslog and sendmail only listen locally. Check withnetstat -an | grep LISTENafter the change. - A Reduced Network or Core install plus
netservices limitedis a reasonable hardened base for appliances; for general servers, Entire with the limited profile and individually disabled services is easier to support.
Zones: the global zone decides
Non-global zones in Solaris 10 do not have their own software group. They are built from the packages installed in the global zone:
- A sparse-root zone (the default) shares
/lib,/platform,/sbinand/usrread-only from the global zone throughinherit-pkg-dir. If a package is not installed in the global zone, the zone cannot have it in those directories either. - A whole-root zone gets its own copy of the packages but still starts from the global zone’s package set.
- Adding a package in the global zone with plain
pkgaddalso installs it in all existing non-global zones (unless the package is marked to stay in the current zone).pkgadd -Glimits the install to the global zone. - Removing a package in the global zone removes it from the zones as well. On a zone host, minimize the global zone conservatively, or the applications in the zones lose software they need.
Patching implications
- Patches only apply to packages that are installed. A small group means fewer patches and shorter patch windows.
- A package added later from the DVD is at the media patch level; patch it immediately (see Step 4).
- Live Upgrade and the Recommended Patchset work on every group, but your own list of added and removed packages must be reapplied when you rebuild a system from scratch, so keep it in the JumpStart profile rather than in your head.
Verification checklist
# cat /var/sadm/system/admin/CLUSTER
CLUSTER=SUNWCreq
# pkginfo | wc -l
# pkginfo -p # partially installed packages: should print nothing
# pkgchk -n SUNWsshdu SUNWsshdr # file attributes and checksums of chosen packages
# for p in SUNWbtool SUNWsprot SUNWtoo; do pkginfo -q $p || echo "missing $p"; done
# svcs -xv # no services broken by missing packages
# netservices limited ; netstat -an | grep LISTEN
CLUSTERshows the group you chose at install time.pkginfo -pprints nothing (no half-installed packages after adds and removals).- The loop prints nothing when every package your applications need is present.
svcs -xvprints nothing. A service in maintenance whose log mentions a missing binary or library is the usual symptom of over-minimizing.
Troubleshooting and gotchas
- “command not found” for a standard tool. The package is not in your group. Find the owner with
grepon the mediapkgmapfiles, as in Step 4. Developer tools such asmake,arandnmin/usr/ccs/bin, and GCC in/usr/sfw/bin, are typical (see part 8, The Solaris PATH Problem). - No
manpages. The man page packages are not in the small groups. Add them from the DVD or read the pages on another system or in the online library. - X11 forwarding or a vendor GUI installer fails. Core has no X11 libraries. Add the X11 packages the vendor lists, or run the vendor’s silent installer instead.
- Vendor installer prerequisite check fails. Add exactly the packages it names from the DVD, then patch them. Installing a larger group on top is not possible without reinstalling.
- Hardware not found after the install (often on x86). The driver is in the OEM part; you installed a group smaller than
SUNWCXall. Add the driver package from the DVD and rundevfsadm, or reinstall withSUNWCXall. - Wrong architecture.
pkgaddrefuses a package from the SPARC DVD on x86 and vice versa. Use the media for the platform. - Zone install fails or a zone application breaks after minimizing. The global zone lacks or lost a package that sparse zones inherit. Add it in the global zone (without
-G) so it reaches the zones. - Upgrade does not add the software you expected. Upgrades stay within the installed group. Add the packages afterwards, or reinstall with a larger group.
Solaris 11.4: group packages instead of software groups
Solaris 11 replaced SVR4 packages and software groups with the Image Packaging System (IPS). The idea survives as group packages, and minimizing is much easier because IPS resolves dependencies itself:
| Solaris 11.4 group package | Roughly comparable to |
|---|---|
group/system/solaris-minimal-server | Below Core: a minimal bootable system, the base for heavily minimized builds |
group/system/solaris-small-server | Core-like server without desktop; the default for non-global zones |
group/system/solaris-large-server | A full server without desktop; the default for the text installer and Automated Installer |
group/system/solaris-desktop | End User/Entire with the GNOME desktop; installed by the Live Media |
# pkg list -a 'group/system/solaris-*'
# pkg contents -r -t depend -a type=group -o fmri group/system/solaris-small-server
# pkg install group/system/solaris-desktop # grow a system, dependencies included
# pkg uninstall sendmail # remove a member of a group package
# pkg avoid # members you removed: now on the avoid list
# pkg unavoid sendmail # allow it to be installed again
# pkg facet # list facets
# pkg change-facet facet.doc.man=false # drop man pages system-wide
- Members of a group package are
groupdependencies: you can uninstall them, and IPS puts them on the avoid list so updates do not reinstall them.pkg avoidshows the list. - Facets trim content inside packages, for example
facet.doc.man,facet.develorfacet.locale.*, without removing the packages themselves. - Zones in 11.4 have their own package image, so the global zone no longer limits what a zone can install (core OS packages are kept in sync with the global zone through linked images).
- There is no
/var/sadm/system/admin/CLUSTER;pkg listshows which group packages are installed, and the AI manifest records the choice for rebuilds. Solaris 11 gets its own packaging posts later in the series.
What’s next in the Solaris Admin Series
Next up: creating a sysidcfg file for hands-off system identification, so the identity questions from part 12, Solaris Hostname, Time Zone, Locale and Keyboard, and parts 14 and 15 are answered before the installer asks them. After that comes JumpStart, where the profile from Step 2 is put to work. Catch up with part 15, Installing Solaris 10 on x86, part 14, Installing Solaris 10 on SPARC, part 5, Solaris First-Day Commands and part 1, Solaris 10 and 11.4 Releases and Support Lifecycle.
Official references: Oracle Solaris 10 1/13 Installation Guide: Planning for Installation and Upgrade (Disk Space Recommendations for Software Groups), Installation Guide: JumpStart Installations (profile keywords cluster and package, pfinstall), System Administration Guide: Basic Administration (Managing Software Packages) and Oracle Solaris Zones in the Oracle Solaris 10 1/13 Information Library; Adding and Updating Software in Oracle Solaris 11.4; and the man pages for pkginfo(1), pkgadd(1M), pkgrm(1M), pkgchk(1M), admin(4), clustertoc(4), netservices(1M) and pkg(1).
