{"id":2116,"date":"2015-06-14T17:55:44","date_gmt":"2015-06-14T15:55:44","guid":{"rendered":"http:\/\/possiblelossofprecision.net\/?p=2116"},"modified":"2021-05-15T11:46:37","modified_gmt":"2021-05-15T09:46:37","slug":"creating-a-local-omnios-repository","status":"publish","type":"post","link":"https:\/\/possiblelossofprecision.net\/?p=2116","title":{"rendered":"Creating a local OmniOS repository"},"content":{"rendered":"<p>Sometimes it is a good idea or even necessary to have a local mirror of OmniOS available, i.e. if you do not want to allow your severs direct access to the outside world. Setting up a local OmniOS repository is rather simple.<\/p>\n<h2>1. Create a local package repo<\/h2>\n<p>To create an empty repo, run pkgrepo:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\npkgrepo create \/path\/to\/repo\r\n<\/pre>\n<h2>2. Grab packages from remote repo<\/h2>\n<p>To mirror a remote repository to the newly created local repository, you can use:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\npkgrecv -s http:\/\/pkg.omniti.com\/omnios\/r151014\/ -d \/path\/to\/repo '*'\r\n<\/pre>\n<p>You could, of course, also restrict it to individual packages or exclude certain packages.<\/p>\n<h2>3. Update the local repository<\/h2>\n<p><a href=\"http:\/\/docs.oracle.com\/cd\/E23824_01\/html\/E21803\/updaterepo.html\">Updating the local repository<\/a> is essentially the same as downloading it. Re-run <code>pkgrecv<\/code> and new packages will be fetched. Don&#8217;t forget to run <code>refresh<\/code> on the repo afterwards to catalog any new packages found in the repository and update search indexes:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# pkgrecv -s http:\/\/pkg.omniti.com\/omnios\/r151014\/ -d \/path\/to\/repo omnios '*'\r\n# pkgrepo -s \/path\/to\/repo refresh\r\n<\/pre>\n<h2>4. Add the local repository as a publisher<\/h2>\n<p>You need to tell your server to use your local repository instead of the upstream one:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# pkg set-publisher -G '*' -g file:\/\/\/path\/to\/repo\/ omnios\r\n<\/pre>\n<p>For a more comprehensive documentation of the available options to <code>set-publisher<\/code> have a look at the <a href=\"http:\/\/docs.oracle.com\/cd\/E23824_01\/html\/E21802\/publisher-config.html\">&#8216;Configuring Publishers&#8217; page<\/a> at Oracle.<\/p>\n<h2>5. Refresh publisher metadata and install packages<\/h2>\n<p>After refreshing the publisher metadata you are ready to install packages from your local repository<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# pkg refresh --full\r\n# pkg install &lt;packagename&gt;\r\n<\/pre>\n<h2>6. A note on mirroring ms.omniti.com<\/h2>\n<p>Creating a mirror of <code>ms.omniti.com<\/code> works the same as any other repository. Be sure, however, to use the <code>-m all-versions<\/code> flag when downloading the packages into the local repo:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# pkgrepo create \/path\/to\/ms.omniti.com\/\r\n# pkgrecv -s http:\/\/pkg.omniti.com\/omniti-ms\/ -d  file:\/\/\/mnt\/rpm-repo\/omnios\/ms.omniti.com\/ -m all-versions '*'\r\n<\/pre>\n<p>More options to <code>pkgrecv<\/code> can be found at <a href=\"http:\/\/docs.oracle.com\/cd\/E23824_01\/html\/E21796\/pkgrecv-1.html\">Oracle&#8217;s pkgrecv manpage<\/a>. To enable the local <code>ms.omniti.com<\/code> repository on your machine, run<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# pkg set-publisher -G '*' -g file:\/\/\/path\/to\/ms.omniti.com\/ ms.omniti.com\r\n<\/pre>\n<p>Resources and further reading:<br \/>\n<a href=\"https:\/\/blogs.oracle.com\/observatory\/entry\/quick_local_repository\">https:\/\/blogs.oracle.com\/observatory\/entry\/quick_local_repository<\/a><br \/>\n<a href=\"http:\/\/serverfault.com\/questions\/348139\/how-to-manually-download-individual-files-from-the-openindiana-or-solaris-pkg\">http:\/\/serverfault.com\/questions\/348139\/how-to-manually-download-individual-files-from-the-openindiana-or-solaris-pkg<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes it is a good idea or even necessary to have a local mirror of OmniOS available, i.e. if you do not want to allow your severs direct access to the outside world. Setting up a local OmniOS repository is rather simple. 1. Create a local package repo To create an empty repo, run pkgrepo: pkgrepo create \/path\/to\/repo 2. Grab&#8230; <a href=\"https:\/\/possiblelossofprecision.net\/?p=2116\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[72,70],"class_list":["post-2116","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-omnios","tag-solaris"],"_links":{"self":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/2116","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2116"}],"version-history":[{"count":7,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/2116\/revisions"}],"predecessor-version":[{"id":2127,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/2116\/revisions\/2127"}],"wp:attachment":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}