Monday, April 24, 2017

How to add a SRU to a local IPS repository

How to add a SRU to a local IPS repository

Last time we created a local IPS https repository, see HTTPS IPS repository using pkg.depotd.

The April CPU just came out, so let's add the latest and greatest SRU (19.5 at the time of writing this) to our local repository. Go to MOS and search for "Oracle Solaris 11.3 Support Repository Updates (SRU) Index (Doc ID 2045311.1)" to download the newest IPS Repository

Six gigabytes later you should have five files.

# ls
p25791246_1100_SOLARIS64_1of4.zip   p25791246_1100_SOLARIS64_3of4.zip   p25791250_1100_SOLARIS64.zip
p25791246_1100_SOLARIS64_2of4.zip   p25791246_1100_SOLARIS64_4of4.zip

Instead of just adding the new SRU bits to the repository we're following the official documentation to minimize repository downtime, see How to Update a Local IPS Package Repository.

Update a copy of the repository. This practice helps ensure that systems do not access the repository while the repository is being updated. Create a snapshot of your repository before you update the repository, clone the snapshot, perform the update, and replace the original repository with the updated clone.

Sounds good, let's do that (the pkgrepo verify step is optional).

# zfs clone tank/install/pkgrepo/solaris@ga tank/install/pkgrepo/solaris_tmp

# unzip p25791250_1100_SOLARIS64.zip
...
# LC_ALL=C ./install-repo.ksh -c -d /install/pkgrepo/solaris_tmp -y
Using p25791246_1100_SOLARIS64 files for sol-11_3_19_5_0-incr-repo download.

Comparing digests of downloaded files...done. Digests match.
...
Initiating repository rebuild.

# pkgrepo -s /install/pkgrepo/solaris_tmp verify
This is where the IPS repository downtime starts.
# svcadm disable -s pkg/server:solaris
# zfs promote tank/install/pkgrepo/solaris_tmp
# zfs rename tank/install/pkgrepo/solaris tank/install/pkgrepo/solaris_old
# zfs rename tank/install/pkgrepo/solaris_tmp tank/install/pkgrepo/solaris
# svcadm enable pkg/server:solaris

And our repository is back online. Just a little housekeeping left before we're done.

# zfs destroy tank/install/pkgrepo/solaris_old
# zfs snapshot tank/install/pkgrepo/solaris@sru19

And that's it. Our Solaris clients should see installed packages that have newer versions available when running pkg list -u. If not refreshing the publisher metadata with pkg refresh should help.

Read the next part at AI install server using a https IPS repo.

Links

No comments:

Post a Comment

389 Directory Server 1.3.x LDAP client authentication

389 Directory Server 1.3.x LDAP client authentication Last time we did a multi-master replication setup, see 389 Directory Server 1.3.x Repl...