[ About | Licence | Contacts ]
Written by Oleksandr Gavenko (AKA gavenkoa), compiled on 2024-04-01 from rev 052223c22317.

Solaris

Documentation

http://www.oracle.com/technetwork/server-storage/solaris11/documentation/index.html
Oracle Solaris 11 Product Documentation.

Add new user

$ useradd -d /export/home/fred -m -s /bin/ksh -c "Fred Smith" fred

where -d is path to HOME dir, -m create home directory if necessary and copy the default skeleton files, -s your favourite shell, -c your full name.

On Solaris /home dir inaccessible for creating home dir.

Change attribute of already exists user:

$ usermod -d /export/home/new-home-dir -s /usr/bin/bash

Network configuration

List the phyiscal interfaces:

$ dladm show-phys

Show status of interfaces:

$ dladm show-link

List the network interfaces:

$ ipadm show-if
$ ipadm show-addr
$ netadm list
$ ifconfig -a

Solaris host name with version up to 10 is configured via:

$ cat /etc/nodename
sparc

Starting from Solaris 11 you should run:

$ svccfg -s system/identity:node
svc:/system/identity:node> listprop config
config                      application
config/enable_mapping       boolean     true
config/ignore_dhcp_hostname boolean     true
config/nodename             astring     old-hostname
config/loopback             astring     old-hostname
svc:/system/identity:node> setprop config/nodename=new-hostname
svc:/system/identity:node> setprop config/loopback=new-hostname
svc:/system/identity:node> exit

$ svccfg -s system/identity:node refresh
$ svcadm restart system/identity:node
$ hostname
$ cat /etc/resolv.conf    (Настройки DNS)
domain bifit.int
nameserver 192.168.1.1
$ cat /etc/hostname.eri0  (имя из hosts или IP)
sparc
$ cat /etc/hosts          (назначение IP хосту)
#
# Internet host table
#
::1 localhost             (обязательная строка)
127.0.0.1   localhost     (обязательная строка)
192.168.1.41    sparc   loghost   (обязательная строка, имя настраиваемого хоста и его IP)
192.168.1.26    gavenko
$ cat /etc/netmask        (назначить сетевую маску для подсетей)
#
#   network-number  netmask
#
192.168.1.0 255.255.255.0

Mounting ISO Images in Solaris

$ /usr/sbin/lofiadm -d /dev/lofi/1
$ /usr/sbin/lofiadm -a /var/tmp/CDImage.iso
$ [ -d /mnt ] && echo OK || echo FAILURE
$ /usr/sbin/umount /mnt
$ /usr/sbin/mount -F hsfs -o ro /dev/lofi/1 /mnt
$ cd /mnt

Package management

List installed packages:

$ pkg list -a
$ pkg list -as                # short

List all available package:

$ pkg list -af
$ pkg list -afs               # short
$ pkg list -af | grep emacs

Show package info:

$ pkg info diagnostic/tcpdump

Search for keyword in installed packages descriptions:

$ pkg search -l editor

Show package content:

$ pkg contents diagnostic/tcpdump

Show installation history:

$ pkg history

Check all packages integrity:

$ pkg verify

Check specific package integrity:

$ pkg verify emacs

Try to fix installation issues:

$ pkg fix emacs

List enabled package sources:

$ pkg publisher

Check package status and update date of official package repository (Oracal Portal):

$ pkgrepo info -s http://pkg.oracle.com/solaris/release/

Install package:

$ pkg install diagnostic/tcpdump
$ pkg install diagnostic/tcpdump@latest

Uninstall package:

$ pkg uninstall diagnostic/tcpdump

Third party package repositories

Today OpenCSW provides varios FOSS package builds. Install pkgutil:

$ pkgadd -d http://get.opencsw.org/now

update package list:

$ /opt/csw/bin/pkgutil -U

and install software from OpenCSW:

$ /opt/csw/bin/pkgutil -y -i emacs
$ /usr/sbin/pkgchk -L CSWemacs # list files

Keep package update:

$ pkgutil -U -u -y
http://opencsw.org/
Open Community Software Project. Free, volunteer effort, to provide quality downloadable binary packages for the currently fully supported versions of Solaris.
https://en.wikipedia.org/wiki/OpenCSW
OpenCSW Wikipedia page.
https://www.opencsw.org/manual/for-maintainers/filesystem-layout.html
OpenCSW filesystem layout

Deprecated 3rd party package repositories

http://sunfreeware.com/
Solaris Freeware Project. Starting from 2013 year become a paid service.
https://unixpackages.com/
Pain version of http://sunfreeware.com/
https://en.wikipedia.org/wiki/Blastwave.org
History of http://www.blastwave.org/ Now dead project. http://opencsw.org/ is forked from this project in 2008.