Go to main content

Creating Package Repositories in Oracle® Solaris 11.4

Exit Print View

Updated: November 2018
 
 

Updating Repositories with HTTP Locations

You cannot add packages to or remove packages from a repository by using the http location of the repository if the value of the pkg/readonly property is true. Do not change the value of the pkg/readonly property. Instead, to update a repository that has an http location configured, use the file system location for that repository. The file system location is the value of the pkg/inst_root property of the pkg/server service instance for this repository.

The following commands show that the repository at /var/share/pkgrepos/solaris can be accessed at pkg.example.com:80:

$ svcprop -t -p pkg/inst_root -p pkg/port -p pkg/readonly -p pkg/standalone \
pkg/server:solaris
pkg/standalone boolean false
pkg/readonly boolean true
pkg/port count 80
pkg/inst_root astring /var/share/pkgrepos/solaris
$ svcprop -p config/host pkg/depot:default
pkg.example.com

The following commands show that you can get information about the repository by using the http location. The solaris in the -s and -g arguments is the name of the pkg/server service instance: pkg/server:solaris. If the value of pkg/standalone were true, the value of the -s and -g arguments would be simply http://pkg.example.com/.

$ pkgrepo -s http://pkg.example.com/solaris info
PUBLISHER PACKAGES STATUS           UPDATED
solaris   1404     online           2017-06-30T19:01:49.247256Z
$ pkgrepo -s http://pkg.example.com/solaris list entire
PUBLISHER NAME                                          O VERSION
solaris   entire                                          0.5.11,5.11-0.175.3.18.0.6.0:20170322T192451Z
$ pkg list -g http://pkg.example.com/solaris entire
NAME (PUBLISHER)                                  VERSION                    IFO
entire                                            0.5.11-0.175.3.18.0.6.0    ---

The following commands show that you cannot add packages to or remove packages from the repository by using the http location, but you can update the repository by using the underlying file system location. Best practice is to always leave pkg/readonly set to true and use the repository file system location to update the repository.

$ pkgrecv -s testrepo -d http://pkg.example.com/solaris testpkg
Processing packages for publisher solaris ...
Retrieving and evaluating 1 package(s)...
PROCESS                                         ITEMS    GET (MB)   SEND (MB)
testpkg                                           0/1     0.0/0.0     0.0/0.0
pkgrecv: 'open' failed for transaction ID 'id': Publisher 'solaris' has no 
repositories that support the 'open/0' operation.
$ pkgrecv -s testrepo -d /var/share/pkgrepos/solaris testpkg
Processing packages for publisher solaris ...
Retrieving and evaluating 1 package(s)...
PROCESS                                         ITEMS    GET (MB)   SEND (MB)
Completed                                         1/1     0.0/0.0     0.0/0.0
$ pkg list -g http://pkg.example.com/solaris testpkg
NAME (PUBLISHER)                                  VERSION                    IFO
testpkg                                           1.0                        ---
$ pkgrepo -s http://pkg.example.com/solaris remove testpkg
pkgrepo remove: Network repositories are not currently supported for this operation.
$ pkgrepo -s /var/share/pkgrepos/solaris remove testpkg
Removing packages for publisher solaris ...
Deleting search index                           Done
Updating catalog                                Done
Analyzing removed packages                       1/1
Analyzing repository packages              1430/1430
Removing package manifests                       1/1
Removing package files                           1/1
$ pkg list -g http://pkg.example.com/solaris testpkg
pkg list: no packages matching 'testpkg' known
$ pkg list -g /var/share/pkgrepos/solaris testpkg
pkg list: no packages matching 'testpkg' known