{"id":67,"date":"2018-12-01T17:43:29","date_gmt":"2018-12-01T09:43:29","guid":{"rendered":"https:\/\/www.ientertech.com\/blog\/?p=67"},"modified":"2018-12-01T17:43:29","modified_gmt":"2018-12-01T09:43:29","slug":"pkgin-%e4%bd%bf%e7%94%a8%e8%af%b4%e6%98%8e%ef%bc%88%e8%8b%b1%e6%96%87%ef%bc%89%e8%bd%ac","status":"publish","type":"post","link":"https:\/\/www.ienter.com.cn\/blog\/2018\/12\/pkgin-%e4%bd%bf%e7%94%a8%e8%af%b4%e6%98%8e%ef%bc%88%e8%8b%b1%e6%96%87%ef%bc%89%e8%bd%ac.html","title":{"rendered":"pkgin \u4f7f\u7528\u8bf4\u660e\uff08\u82f1\u6587\uff09\u8f6c"},"content":{"rendered":"<p>\u51fa\u5904\uff1ahttps:\/\/sourceforge.net\/p\/pkgin\/pkgin\/ci\/master\/tree\/<\/p>\n<p>Minix3\u4f7f\u7528pkgin\u7ba1\u7406\u8f6f\u4ef6\uff0c\u4e0b\u9762\u53ef\u505a\u53c2\u8003<\/p>\n<p>pkgin, a binary package manager for pkgsrc<br \/>\npkgin is aimed at being an apt \/ yum like tool for managing pkgsrc binary packages. It relies on pkg_summary(5) for installation, removal and upgrade of packages and associated dependencies, using a remote repository.<\/p>\n<p>Quickstart<br \/>\nPrerequisites<br \/>\nUsage<br \/>\nUsage examples<br \/>\nPlatforms<br \/>\nRationale<br \/>\nMany so-called GNU\/Linux distributions provide a convenient way of searching, installing and upgrading software by using binary archives found on \"repositories\". NetBSD, and more widely, all operating systems relying on pkgsrc have tools like pkg_add and pkg_delete, but those are unable to correctly handle binary upgrades, and sometimes even installation itself.<\/p>\n<p>This is the purpose of pkgin, to provide the user a convenient way to handle binary packages, using the same working mechanisms than tools like apt-get.<\/p>\n<p>Disclaimer<br \/>\nAs pkgin CVS code may change quite deeply, please do not forget to look at the CHANGES file if you chose to track development version.<\/p>\n<p>Prerequisites<br \/>\npkgin is developed using the C language. It uses sqlite3 as a package database backend, in order to provide good speed on older architectures.<\/p>\n<p>If you wish to build pkgin from sources, the following dependencies must be met<\/p>\n<p>databases\/sqlite3<br \/>\npkgtools\/libnbcompat (yes, even for NetBSD)<br \/>\nnet\/libfetch<br \/>\narchivers\/libarchive<br \/>\nSince NetBSD 6.0, all of those are provided as part of the base system, except for libnbcompat.<br \/>\nPkgin is available via CVS, pkgsrc-wip and is available in pkgsrc as pkgtools\/pkgin.<\/p>\n<p>While installing via pkgsrc is the preferred method, you may want to track CVS version to help improving pkgin's quality. To check it out, use the following commands:<\/p>\n<p>$ cvs -d:pserver:anonymous@cvs.pkgin.net:\/cvsroot\/pkgin login<br \/>\npasswd: [enter]<br \/>\n$ cvs -z3 -d:pserver:anonymous@cvs.pkgin.net:\/cvsroot\/pkgin co -P pkgin<br \/>\nInvoke the configure script, for example:<\/p>\n<p>$ .\/configure --prefix=\/usr\/pkg --with-libraries=\/usr\/pkg\/lib --with-includes=\/usr\/pkg\/include<br \/>\nAnd finally build the binary:<\/p>\n<p>$ make<br \/>\npkgin is ready to run !<\/p>\n<p>Usage<br \/>\nFirst thing to do before using pkgin is to setup a repository in the ${PREFIX}\/etc\/pkgin\/repositories.conf file :<\/p>\n<p>$ echo ftp:\/\/ftp.fr.netbsd.org\/pub\/pkgsrc\/packages\/NetBSD\/i386\/5.0\/All &gt; \/usr\/pkg\/etc\/pkgin\/repositories.conf<br \/>\nNow you can build the initial database:<\/p>\n<p># pkgin update<br \/>\nThis operation will download the pkg_summary(5) file from the repository and then populate the SQLite database.<\/p>\n<p>Once this is completed, pkgin is fully functionnal.<\/p>\n<p>The pkgin update command must be run regularly in order to keep the database synchronized with the repository.<\/p>\n<p>Usage examples<br \/>\nList available packages:<\/p>\n<p># pkgin avail<br \/>\nList installed packages:<\/p>\n<p># pkgin list<br \/>\nSearch for a regular expression in the database:<\/p>\n<p># pkgin search foo.*bar<br \/>\nInstall a package and its dependencies:<\/p>\n<p># pkgin install foo<br \/>\nInstall many packages and their dependencies:<\/p>\n<p># pkgin install foo bar baz<br \/>\nInstall a package and its dependencies using a \"glob\" syntax (pkgin 0.5 and up):<\/p>\n<p># pkgin install 'foo&lt;5.0'<br \/>\nRemove a package and its reverse dependencies:<\/p>\n<p># pkgin remove foo<br \/>\nUpgrade a package:<\/p>\n<p># pkgin install foo<br \/>\nRemove orphan dependencies:<\/p>\n<p># pkgin autoremove<br \/>\nMark a package as \"keepable\", i.e. a package that probably has not been installed by pkgin but that is not an orphan dependency:<\/p>\n<p># pkgin keep foo<br \/>\nMark a package as \"non-keepable\":<\/p>\n<p># pkgin unkeep foo<br \/>\nUpgrade keepable packages to their newer versions present in the repository. If the installed dependencies match the listed needed dependencies, don't upgrade them:<\/p>\n<p># pkgin upgrade<br \/>\nUpgrade all packages to their newer versions present in the repository:<\/p>\n<p># pkgin full-upgrade<br \/>\nDelete downloaded packages from the cache directory:<\/p>\n<p># pkgin clean<br \/>\nShow package direct dependencies:<\/p>\n<p># pkgin show-deps foo<br \/>\nShow package full dependency tree:<\/p>\n<p># pkgin show-full-deps foo<br \/>\nShow package reverse dependency tree (packages depending directly or indirectly):<\/p>\n<p># pkgin show-rev-deps foo<br \/>\nAssume \"yes\" for all questions:<\/p>\n<p># pkgin -y install foo<br \/>\nExport your keep-list (in pkg_chk(8) format, pkgin 0.5 and up):<\/p>\n<p># pkgin export &gt; my-packages<br \/>\nImport a package list (in pkg_chk(8) format, pkgin 0.5 and up):<\/p>\n<p># pkgin import my-packages<br \/>\nShows what a package provides (pkgin 0.5 and up):<\/p>\n<p># pkgin provides foo<br \/>\nShows what a package requires (pkgin 0.5 and up):<\/p>\n<p># pkgin requires foo<br \/>\nShow packages belonging to category (pkgin 0.6 and up):<\/p>\n<p># pkgin show-category www<br \/>\nShow package's category (pkgin 0.6 and up):<\/p>\n<p># pkgin show-pkg-category foo<br \/>\nShow remote package's content (pkgin 0.6 and up):<\/p>\n<p># pkgin pkg-content foo<br \/>\nShow remote package's long-description (pkgin 0.6 and up):<\/p>\n<p># pkgin pkg-descr foo<br \/>\nShow remote package's build definitions (pkgin 0.6 and up):<\/p>\n<p># pkgin pkg-build-defs foo<br \/>\nEvery command has a shortcut, pkgin -h will show them.<\/p>\n<p>Platforms<br \/>\npkgin is known to work and have been tested under the following platforms :<\/p>\n<p>NetBSD {4,5,6, current}<br \/>\nDragonFly BSD 2.0 to 3.0<br \/>\nSolaris 10\/SunOS 5.10<br \/>\nOpensolaris\/SunOS 5.11<br \/>\nDebian GNU\/Linux {5,6}<br \/>\nMac OS X 10.{5,6}<br \/>\nMINIX 3.2.0<br \/>\nContact<br \/>\nPlease do not hesitate to contact me, either by mail at imil@NetBSD.org or iMil on the Freenode IRC Network.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u51fa\u5904\uff1ahttps:\/\/sour...<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-67","post","type-post","status-publish","format-standard","hentry","category-minix"],"_links":{"self":[{"href":"https:\/\/www.ienter.com.cn\/blog\/wp-json\/wp\/v2\/posts\/67","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ienter.com.cn\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ienter.com.cn\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ienter.com.cn\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ienter.com.cn\/blog\/wp-json\/wp\/v2\/comments?post=67"}],"version-history":[{"count":0,"href":"https:\/\/www.ienter.com.cn\/blog\/wp-json\/wp\/v2\/posts\/67\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ienter.com.cn\/blog\/wp-json\/wp\/v2\/media?parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ienter.com.cn\/blog\/wp-json\/wp\/v2\/categories?post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ienter.com.cn\/blog\/wp-json\/wp\/v2\/tags?post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}