solaris 11 exercise ips (1)

1. Log in to your machine.
ssh user1@192.168.4.151

switch to root
# sudo bash
Password: e1car0

2. Your machine has the Full Repository iso mounted.
# df -h | grep media
/dev/dsk/c3t0d0s2 6.8G 6.8G 0K 100% /media/SOL_11_1_REPO_FULL

Check the available disks.
# format
AVAILABLE DISK SELECTIONS:
0. c4t0d0
/pci@0,0/pci15ad,1976@10/sd@0,0
1. c4t2d0
/pci@0,0/pci15ad,1976@10/sd@2,0

Use disk c4t2d0 (for example) to create a zpool for your repository.
# zpool create software c4t2d0
# zpool list
NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
rpool 19.9G 6.96G 12.9G 35% 1.00x ONLINE -
software 19.9G 112K 19.9G 0% 1.00x ONLINE -

Create a zfs filesystem for your repository.
# zfs create software/ips

3. Check your publisher.
# pkg publisher
PUBLISHER TYPE STATUS URI
solaris origin online http://pkg.oracle.com/solaris/release/

Create a repository.
# pkgrepo create /software/ips/
# ls /software/ips
pkg5.repository

To pupulate your repository choose 4a or 4b as a method.
4a. Populate your new repository.
# rsync -aP /media/SOL_11_1_REPO_FULL/repo /software/ips
(this will take some time 6.8GB)

Refresh your repository.
# pkgrepo refresh -s /software/ips

4b.
# pkgrepo create /software/ips
# pkgrecv -s http://pkg.oracle.com/solaris/release/ -d /software/ips '*'

5. Make your repository accessible for others.
# zfs set share=name=s11repo,path=/software/ips,prot=nfs software/ips
# zfs set sharenfs=on software/ips
# dfshares
RESOURCE SERVER ACCESS TRANSPORT
solaris11-4:/software/ips solaris11-4 - -

6. Set the inst_root for the pkg service.
# svccfg -s application/pkg/server setprop pkg/inst_root=/software/ips
# svcadm refresh pkg/server
# svcadm disable pkg/server
# svcadm enable pkg/server

Check your colleague's work and use his repository.
# pkg set-publisher -G'*' -M'*' -g /net/192.168.4.154/software/ips/ solaris

7. Remove the xkill package from your system.
# pkg uninstall xkill

Install the package again.
# pkg install xkill

8. Change the package, verify and repair.
# pkg contents xkill
PATH
usr/X11/bin/xkill
usr/bin/xkill
usr/share/man/man1/xkill.1

# chmod 000 /usr/bin/xkill
# pkg verify xkill
PACKAGE STATUS
pkg://solaris/x11/xkill ERROR
file: usr/bin/xkill
Mode: 0000 should be 0555

# pkg fix xkill

9. Create your own package and publish it.

# svcadm disable application/pkg/server
# svccfg -s application/pkg/server setprop pkg/readonly=false
# svcadm refresh application/pkg/server
# svcadm enable application/pkg/server

Create a directory to hold your software.
# mkdir -p /var/tmp/new
# cd /var/tmp/new
# vi newpackage
This is a new package.
:wq!

# eval 'pkgsend -s http://192.168.4.154 open newpackage@1.0-1'
export PKG_TRANS_ID=1392650521_pkg%3A%2F%2Fsolaris%2Fnewpackage%401.0%2C5.11-1%3A20 140217T152201Z

# export PKG_TRANS_ID=1392650521_pkg%3A%2F%2Fsolaris%2Fnewpackage%401.0%2C5.11-1%3A20140217T152201Z

# pkgsend -s \
> http://192.168.4.154 add dir mode=0555 owner=root \
> group=bin path=/export/newpackage

# pkgsend -s http://192.168.4.154 \
> add file /var/tmp/new/newpackage mode=0555 owner=root group=bin \
> path=/export/newpackage/newpackage

# pkgsend -s http://192.168.4.154 \
> add set name=description value="MyPackage"

# pkgsend -s http://192.168.4.154 \
> close
PUBLISHED
pkg://solaris/newpackage@1.0,5.11-1:20140217T152201Z

# svccfg -s pkg/server setprop pkg/readonly=true
# svcadm enable pkg/server

# pkg search newpackage
INDEX ACTION VALUE PACKAGE
basename file software/ips/new/newpackage pkg:/newpackage@1.0-1
pkg.fmri set solaris/newpackage pkg:/newpackage@1.0-1

# pkg install newpackage

More IPS

In a terminal window on the Sol11-Desktop virtual machine, determine if the apptrace
software package is currently installed.
# pkg list apptrace
pkg list: no packages matching 'apptrace' installed

Search the IPS package repository for the apptrace software package.
# pkg search apptrace
INDEX ACTION VALUE PACKAGE
pkg.description set Apptrace utility for application tracing,
including shared objects pkg:/developer/apptrace@0.5.11-0.175.0.0.0.2.1

Display detailed information about the apptrace package from the remote repository by
using the -r option
# pkg info -r apptrace
Name: developer/apptrace
Summary: Apptrace Utility
Description: Apptrace utility for application tracing,
including shared objects
Category: Development/System
State: Not installed
Publisher: solaris

Perform a dry run  on the apptrace package installation.
# pkg install -nv apptrace

The dry run shows that one package will be installed. The package installation will not affect the boot environment. No currently installed packages will be changed. Note that
an FMRI is the fault management resource identifier. The FMRI is the identifier for this
package. The FMRI includes the package publisher, name, and version. The pkg
command uses FMRIs, or portions of FMRIs, to operate on packages.

Install the apptrace package.
# pkg install apptrace

Verify the apptrace package installation.
# pkg verify -v apptrace
PACKAGE STATUS
pkg://solaris/developer/apptrace OK

Remove the apptrace package from the system image on your host.
# pkg uninstall apptrace

This entry was posted in solaris, Uncategorized. Bookmark the permalink.

Comments are closed.