Upgrading from OpenSolaris to Specific Builds of Solaris 11 Express Pkg Gotchas

There has been a major change in the packaging repositories between OpenSolaris and Solaris 11 Express. OpenSolaris packages were published with the publisher name of opensolaris.org and a base URL of http://pkg.opensolaris.org/ . Solaris 11 Express changes the publisher name to solaris and the base URL to http://pkg.oracle.com/solaris . You will need to postfix either dev/ or release/ to the end of the base URL to get to the appropriate repository.

 In the course of testing, I wanted to upgrade to a specific build of Solaris. I had followed the instructions from a blog entry from The Observatory on how to upgrade to a specific build. Since the publisher changed between the bits that I was currently running (which referenced the publisher of opensolaris.org) to the repo that held the build I wanted (which referenced the publisher of solaris), I had to do some pkg magic to change the publishers.

One thing to keep in mind is that before I did anything, I created a new boot environment to install to:

beadm create snv_151a
beadm mount snv_151a /mnt-solaris11express


The two commands I did to switch publishers was:

pkg set-publisher -P -O http://pkg.oracle.com/solaris/release  solaris

&

pkg set-publisher --non-sticky opensolaris.org

The command I was using to try and upgrade was:

pkg -R /mnt-solaris11express install entire@0.5.11,5.11-0.151.0.1:20101105T054056Z

 One caveat that I found to this process is that if you are going to do a pkg -R <newpath> install of entire, you need to make sure that the two pkg set-publisher commands to change the publisher from opensolaris.org to solaris are \*also\* prefixed with -R <newpath>. I was basically unable to install entire@somebuild to my -R <newroot> even if I gave it the full FMRI to the package. The weird thing was that pkg list -avf entire showed the entire package that I wanted, and the same FMRI. I could not figure it out so I went asking for help from the pkg folks down the hall from me. I was lucky enough to have Brock Pytlik come help me out. He quickly figured out the problem which was due to an incorrect understanding of how I thought the pkg process worked with the -R <path> flag.

As I understand it, pkg -R <path> anything basically chroots to <path> before executing. Disclaimer: I am not partial to how the -R flag is actually implemented, but chroot seems to describe it in terms that I can understand. One thing I did not realize is that the chroot occurs and THEN the publisher information is read in from <path>. I had created a new boot environment before changing my publishers and that led my snapshot boot environment to not have the updated publishers. I had assumed that the pkg install command would have used the current configured information and simply applied to install to -R <path> happily. I did not realize that it actually read in the configuration from <path> and THEN tried to install.

The correct sequence of commands would have been:

beadm create snv_151a

&

beadm mount snv_151a /mnt-solaris11express
pkg -R /mnt-solaris11express set-publisher -P -O http://pkg.oracle.com/solaris/release  solaris

&

pkg -R /mnt-solaris11express set-publisher --non-sticky opensolaris.org

&

pkg -R /mnt-solaris11express install entire@0.5.11,5.11-0.151.0.1:20101105T054056Z


Of course, this all could have been avoided if I changed the publishers and THEN ran the beadm create to create my new boot environment but alas, this is not what I did. If I had done it that way, the beadm create would have taken a snapshot that had the new publisher information configured and none of this would have happened. Sometimes command ordering matters, this is one of those times.

I hope this blog post helps out someone who was in the same predicament as me but did not have the convenience of having a Solaris engineer down the hall. The only alternatives I could see was a pkg image-update to the latest (which would have worked BTW since that does not use the -R <path> flag) and a fresh install to a build that had the publishers correct (which is not what I wanted to do).

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

I am part of the OpenSolaris.org Development Operations team. I have been at Sun since October 2007 where I originally joined the Sun Streaming System, an IPTV video streaming server solution. My primary interests are networking and all related technology

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today