官术网_书友最值得收藏!

Publishing packages into a repository

Certainly, inserting packages into a local repository won't be a very frequent task, but surprisingly, this action saves time. Besides, this topic isn't hard; the process is very interesting because we will learn to handle complex programs such as Veritas Storage Foundations HA.

Getting ready

To follow this recipe, it's necessary that we have a machine (physical or virtual) running Oracle Solaris 11; we log in to the system as the root user and open a terminal. Additionally, it's preferable that our Solaris 11 system has access to the Internet.

How to do it…

We can set the prefix that was previously marked alexandreborges.org to training to make our administration easier and more consistent with the name of the instance service that we chose when an SMF service entry was made for this repository:

root@solaris11:~# pkgrepo set -s /repo_pool/training_repo publisher/prefix=training

An interesting fact is that the repository is usually created as read-only, and to change it to read/write is straightforward:

root@solaris11:~# svccfg -s application/pkg/server:training setprop pkg/readonly=false

The result of the previous command can be seen by running the following command:

root@solaris11:~# svcprop -p pkg/readonly application/pkg/server:training
false

We now reload the configurations and start the repository services again:

root@solaris11:~# svcadm refresh pkg/server:training
root@solaris11:~# svcadm restart pkg/server:training
root@solaris11:~# svcs pkg/server:training
STATE          STIME    FMRI
online         18:37:43 svc:/application/pkg/server:training

The new repository (training) doesn't appear in the publisher list yet:

root@solaris11:~# pkg publisher
PUBLISHER      TYPE    STATUS  P  LOCATION
solaris        origin  online  F  http://pkg.oracle.com/solaris/release/
solarisstudio  origin  online  F  https://pkg.oracle.com/solarisstudio/release/

What's this solarisstudio publisher? Where did this publisher line come from? Relax! I've installed the Oracle Solaris Studio 12.3 to execute some tests (not shown here), but you can disregard it. There's nothing related to the current explanation, but if you're a developer, you can try it from http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index.html.

Returning to the main subject, we need to add the publisher (training) that points to the secondary repository (http://localhost:8888) by running the following command:

root@solaris11:~# pkg set-publisher -O http://localhost:8888 training
root@solaris11:~# pkg publisher
PUBLISHER                   TYPE     STATUS P LOCATION
solaris                     origin   online F http://pkg.oracle.com/solaris/release/
solarisstudio               origin   online F https://pkg.oracle.com/solarisstudio/release/
training                    origin   online F http://localhost:8888/

Finally, let's pick two packages (wireshark and wireshark-common) from the solaris repository and include them in the secondary repository:

root@solaris11:~# pkgrecv -s http://pkg.oracle.com/solaris/release -d /repo_pool/training_repo/publisher/training wireshark
Processing packages for publisher solaris ...
Retrieving and evaluating 1 package(s)...
PROCESS                                     ITEMS    GET (MB)   SEND (MB)
Completed                                    1/1     2.1/2.1     6.0/6.0

root@solaris11:~# pkgrecv -s http://pkg.oracle.com/solaris/release -d /repo_pool/training_repo/publisher/training wireshark-common
Processing packages for publisher solaris ...
Retrieving and evaluating 1 package(s)...
PROCESS                                 ITEMS  GET (MB)   SEND (MB)
Completed                               1/1    33.5/33.5  125.5/125.5

We can confirm our finished task by executing the following command:

root@solaris11:~# pkgrepo info -s /repo_pool/training_repo
PUBLISHER  PACKAGES  STATUS           UPDATED
training   2         online           2013-10-20T22:28:27.023984Z

Using another approach, we are able to obtain the same results in a detailed report from the Apache web server by executing the following commands:

root@solaris11:~# svcadm refresh pkg/server:training
root@solaris11:~# svcadm restart pkg/server:training

We can now open a web browser and go to the URL, http://localhost:8888:

Fantastic! Wireshark packages are now available from the Apache web server and can be downloaded and installed anytime.

An overview of the recipe

Insertion of a package into a local repository is a result of the previous recipe. This kind of operation is performed when a technical team needs to share a new package among its members. The key command is pkgrecv, which does most of the task for us.

主站蜘蛛池模板: 精河县| 洪雅县| 滨海县| 卫辉市| 浮梁县| 阜城县| 视频| 大渡口区| 亳州市| 成安县| 鹤峰县| 商水县| 磐石市| 阳西县| 阳高县| 高唐县| 肃南| 开封市| 东兴市| 民勤县| 五台县| 中方县| 巴楚县| 台州市| 剑河县| 个旧市| 自治县| 灵丘县| 博客| 花莲市| 塘沽区| 承德县| 台中市| 应用必备| 东光县| 麻阳| 临泽县| 黄山市| 镶黄旗| 泾川县| 大丰市|