pkgng
- How to use the pkg(8)
pkg(8)の典型的な使い方は、
インストールしたいアプリケーションがpkg(8)のリモートリポジトリに登録されているかどうかをチェックし、 名前を確認してからインストールを実施するというものです。次に典型的な操作方法を示します。まず、 利用したいと考えているアプリケーションやライブラリの名前で検索をかけます。 # pkg search svn svn2cl-0.
13 Subversion ChangeLog generator svnmailer-py27-1. 1.0. d.r1373_ 5 A tool to post subversion repository commit information ssvnc-1. 0.29 Enhanced TightVNC Viewer (SSVNC: SSL/ SSH VNC viewer) websvn-2. 3.3 Subversion repository web frontend pecl-svn-1. 0.2 A PECL extension to the libsvn library hidesvn-1. 2 Utility that uses LD_ PRELOAD to hide .svn directories psvn-emacs23-915036_ 6 Subversion interface for Emacs cvs2svn-2. 3.0_ 4 CVS to Subversion Repository Converter svndelta-1. 0.6_ 4 Summarizes and manages differences between local files and Subversion svn2git-1. 0.4 Imports svn repositories into git esvn-0. 6.12_ 9 GUI frontend for the Subversion revision system qsvn-0. 8.1_ 5 Qt based GUI frontend for Subversion py27-hgsvn-0. 1.9 Scripts to work locally on Subversion checkouts using Mercurial bzr-svn-1. 2.2_ 1 Plugin for bzr to work with svn svntrac-2. 0.1_ 4 Web-Based Bug And Patch-Set Tracking System For Subversion rsvndump-0. 5.8 Remote Subversion repository dumpfile generator rapidsvn-0. 12. 0_ 3 Cross-platform GUI front-end for the Subversion revision system latex-svninfo-0. 7.4_ 4 A LaTeX package for Subversion support pysvn-1. 7.6 Python binding for Subversion # 該当するアプリケーションを見つけたら、
その名前でインストールを実施します。 # pkg install websvn-2.
3.3 Updating remote repository Remote repository up-to-date, no need to upgrade The following packages will be installed: Installing php5: 5. 4.4 Installing php5-iconv: 5. 4.4 Installing php5-xml: 5. 4.4 Installing websvn: 2. 3.3 The installation will require 14 MB more space 0 B to be downloaded Proceed with installing packages [y/ N]: y Checking integrity... done Installing php5-5. 4.4... done Installing php5-iconv-5. 4.4... done Installing php5-xml-5. 4.4... done Installing websvn-2. 3.3... done ---------------------------------------------------- To setup websvn, please edit the configuration file: /usr/ local/ www/ websvn/ include/ config. php ---------------------------------------------------- # インストールしたアプリケーションの情報はinfoサブコマンドでチェックできます。
# pkg info websvn websvn-2.
3.3 Subversion repository web frontend # アンインストールはremoveサブコマンドで実施できます。infoで名前をチェックしてから、
その名前を指定してアンインストールを実施します。 # pkg remove websvn The following packages will be deinstalled: websvn-2.
3.3 The deinstallation will free 3 MB Proceed with deinstalling packages [y/ N]: y Deinstalling websvn-2. 3.3... done # ここの例ですと、
websvn-2. 3.3をインストールするための関連ソフトウェアとしてインストールされたphp5-iconv-5. 4.4、 php5-xml-5. 4.4、 php5-5. 4.4がシステムに残ってしまいます。これらはautoremoveサブコマンドで自動的に探しだしてアンインストールさせることができます。 # pkg autoremove Packages to be autoremoved: php5-iconv-5.
4.4 php5-xml-5. 4.4 php5-5. 4.4 The autoremoval will free 11 MB Proceed with autoremoval of packages [y/ N]: y Deinstalling php5-iconv-5. 4.4... done Deinstalling php5-xml-5. 4.4... done Deinstalling php5-5. 4.4... done # infoサブコマンドに何も引数を指定しないと、
pkg(8)経由でインストールされたソフトウェアの一覧が表示されます。 # pkg info | head GeoIP-1.
4.8_ 2 Find the country that any IP address or hostname originates from GraphicsMagick-1. 2.10_ 2 Fast image processing tools based on ImageMagick ORBit2-2. 14. 19 High-performance CORBA ORB with support for the C language aalib-1. 4.r5_ 6 An ascii art library alsa-lib-1. 0.23 ALSA compatibility library alsa-plugins-1. 0.23_ 3 ALSA compatibility library plugins appres-1. 0.3 Program to list application's resources apr-ipv6-devrandom-gdbm-db42-1. 4.5. 1.3. 12_ 1 Apache Portability Library aspell-0. 60. 6.1_ 1 Spelling checker with better suggestion logic than ispell atk-2. 0.1 A GNOME accessibility toolkit (ATK) # pkg info | wc -l 550 # 使用しているディスク容量やリモートリポジトリのデータはstatsサブコマンドでチェックすることができます。
# pkg stats Local package database: Installed packages: 550 Disk space occupied: 2973 MB Remote package database(s): Number of repositories: 1 Packages available: 19543 Unique packages: 19543 Total size of packages: 64 GB #
pkg(8)ではインストールされたファイルを指定して、
どのパッケージからインストールされたものかを調べることができます。whichサブコマンドを使用します。従来のwhereis(1)のようなものですが、 実際にインストールした情報からデータを拾ってきて表示している点が異なります。 # pkg which /usr/
local/ bin/ zip /usr/ local/ bin/ zip was installed by package zip-3. 0 # 脆弱性が報告されているソフトウェアに関してはauditサブコマンドで調査することができます。
# pkg audit chromium-19.
0.1084. 56_ 1 is vulnerable: chromium -- multiple vulnerabilities WWW: http:// portaudit. FreeBSD. org/ ff922811-c096-11e1-b0f4-00262d5ed8ee. html firefox-13. 0.1,1 is vulnerable: mozilla -- multiple vulnerabilities WWW: http:// portaudit. FreeBSD. org/ dbf338d0-dce5-11e1-b655-14dae9ebcf89. html thunderbird-13. 0.1 is vulnerable: mozilla -- multiple vulnerabilities WWW: http:// portaudit. FreeBSD. org/ dbf338d0-dce5-11e1-b655-14dae9ebcf89. html 3 problem(s) in your installed packages found. # 従来のパッケージであれば/var/
db/ pkg/以下のファイルを直接チェックしていた作業が、 すべてpkg(8)経由で実施できるようになっています。pkg(8)の操作は直感的でわかりやすく、 FreeBSD 10以降のパッケージ管理を特徴づける機能になりそうです。