q アプレット
q アプレットは C で書かれた小さくて素早い Portage クエリ ( q uery) ユーティリティーのコレクションです。
gentoolkit に比べてより素早く、しかし限定的な代替を提供します。
q アプレットは gentoolkit を置き換えることを意図したものではありません。 q アプレットは eclass を考慮しませんし、 revdep-rebuild や glsa-check のようなツールも提供しません。
インストール
USE フラグ
USE flags for app-portage/portage-utils Small and fast Portage helper tools written in C
+qmanifest
|
Build qmanifest applet, this adds additional dependencies for GPG, OpenSSL and BLAKE2B hashing |
+qtegrity
|
Build qtegrity applet, this adds additional dependencies for OpenSSL |
openmp
|
Build support for the OpenMP (support parallel computing), requires >=sys-devel/gcc-4.2 built with USE="openmp" |
static
|
!!do not set this during bootstrap!! Causes binaries to be statically linked instead of dynamically |
Emerge
q アプレットをインストールします:
root
#
emerge --ask app-portage/portage-utils
使い方
呼び出し
man q または q --help と入力することによって、 app-portage/portage-utils が提供しているアプリケーションの完全なリストが表示されます。このガイドでは最も役立つ機能について短く言及するだけにとどめ、それぞれのアプリケーションに関する情報全てを含めることはしませんので、それぞれのユーティリティについての説明はmanページをご覧ください。
短い説明文付きで利用可能なアプレットを見るには、 q --help を実行します:
user
$
q --help
usage: q <applet> <args> : invoke a portage utility applet
currently defined applets:
q <applet> <args> : virtual applet
qatom <pkg> : split atom strings
qcheck <pkgname> : verify integrity of installed packages
qdepends <pkgname> : show dependency info
qfile <filename> : list all pkgs owning files
qgrep <expr> [pkg ...]: grep in ebuilds
qkeyword <action> <args> : list packages based on keywords
qlist <pkgname> : list files owned by pkgname
qlop <pkgname> : emerge log analyzer
qmanifest <misc args> : verify or generate thick Manifest files
qmerge <pkgnames> : fetch and merge binary package
qpkg <misc args> : create or manipulate Gentoo binpkgs
qsearch <regex> : search pkgname/desc
qsize <pkgname> : calculate size usage
qtbz2 <misc args> : manipulate tbz2 packages
qtegrity <misc args> : verify files with IMA
quse <useflag> : find pkgs using useflags
qwhich <pkg ...> : find path to pkg
qxpak <misc args> : manipulate xpak archives
options: -[ioemvqChV]
-i, --install * Install symlinks for applets
-o, --overlays * Print available overlays (read from repos.conf)
-e, --envvar * Print used variables and their found values
-m, --masks * Print (package.)masks for the current profile
--root <arg> * Set the ROOT env var
-v, --verbose * Report full package versions, emit more elaborate output
-q, --quiet * Tighter output; suppress warnings
-C, --nocolor * Don't output color
--color * Force color in output
-h, --help * Print this help and exit
-V, --version * Print version and exit
あるファイルが含まれているパッケージを見つける方法 (qfile)
qfile コマンドは、ファイルがどのパッケージに属しているか見つけます:
例 1:
user
$
qfile /etc/fonts/fonts.conf
media-libs/fontconfig (/etc/fonts/fonts.conf)
例 2:
user
$
qfile /usr/share/keymaps/atari/atari-uk-falcon.map.gz
sys-apps/kbd (/usr/share/keymaps/atari/atari-uk-falcon.map.gz)
パッケージの整合性検証 (qcheck)
パッケージによってインストールされたファイルのMD5チェックサムや更新日時を確認するには、 qcheck アプリケーションを使います:
user
$
qcheck portage-utils
Checking app-portage/portage-utils-0.1.13 ... * 36 out of 36 files are good
インストール後に変更された全てのファイルがここで報告されます。インストール後に手動で編集された設定ファイルも報告されます (例えば、OpenRC システムでは /etc/conf.d ディレクトリ)。多くのパッケージは root パーミッションを要求しませんが、パッケージに root だけがアクセスできるファイルが含まれている場合は、 qcheck を root として実行する必要があります。
インストールされている すべての パッケージの整合性を確認するには、次を実行してください:
root
#
qcheck
パッケージ依存関係の一覧表示 (qdepends)
この操作はどのパッケージを使用することができるかを表示するもので、必ずしも利用中のシステムで使用されているパッケージを表示するものではありません。インストールされた、または代替ソフトウェアの選択肢にあるパッケージの USE 変数は、常に無視されます。
qdepends
はあるパッケージの依存関係を両方向で一覧表示できます。インストールされている依存パッケージのうち
DEPEND
(
-d
)、
RDEPEND
(
-r
)、
PDEPEND
(
-p
)、または
BDEPEND
(
-b
) を一覧表示するオプションを付けない場合、パッケージが要求するすべての依存パッケージが単一のリストにマージされて表示されます。ebuild 内で見られるような、シェル互換のフォーマットされた依存パッケージのリストを得るには、
-v
を使用してください。
user
$
qdepends mutt
mail-client/mutt-1.13.1: >=app-portage/elt-patches-20170815 >=sys-devel/automake-1.15.1:1.15 dev-libs/libressl:0/47= dev-db/lmdb:0/0.9.24= virtual/libintl www-client/w3m !<sys-devel/gettext-0.18.1.1-r3 dev-libs/libxslt dev-libs/libxml2 >=sys-devel/automake-1.16.1:1.16 >=sys-devel/libtool-2.4 >=sys-devel/autoconf-2.69 net-dns/libidn2 virtual/libiconv >=app-crypt/gpgme-0.9.0:1/11= www-client/elinks app-misc/mime-types app-text/docbook-xsl-stylesheets >=dev-libs/cyrus-sasl-2 www-client/lynx net-mail/mailbase >=sys-libs/ncurses-5.2:0/6=
ebuild 内で見られるような、シェル互換のフォーマットされた依存パッケージのリストを得るには、
-v
を使用してください。
user
$
qdepends -rv mutt
mail-client/mutt-1.13.1:
RDEPEND="
app-misc/mime-types
virtual/libiconv
dev-db/lmdb:0/0.9.24=
dev-libs/libressl:0/47=
virtual/libintl
>=dev-libs/cyrus-sasl-2
net-dns/libidn2
>=app-crypt/gpgme-0.9.0:1/11=
>=sys-libs/ncurses-5.2:0/6=
"
あるパッケージに依存している、すべてのインストールされているパッケージを一覧表示するには、
-Q
オプションを使用してください。
user
$
qdepends -Q mime-types
mail-client/mutt-1.13.1: >=app-portage/elt-patches-20170815 >=sys-devel/automake-1.15.1:1.15 dev-libs/libressl:0/47= dev-db/lmdb:0/0.9.24= virtual/libintl www-client/w3m !<sys-devel/gettext-0.18.1.1-r3 dev-libs/libxslt dev-libs/libxml2 >=sys-devel/automake-1.16.1:1.16 >=sys-devel/libtool-2.4 >=sys-devel/autoconf-2.69 net-dns/libidn2 virtual/libiconv >=app-crypt/gpgme-0.9.0:1/11= app-misc/mime-types www-client/elinks app-text/docbook-xsl-stylesheets >=dev-libs/cyrus-sasl-2 www-client/lynx net-mail/mailbase >=sys-libs/ncurses-5.2:0/6= dev-lang/python-2.7.16: >=app-portage/elt-patches-20170815 >=sys-libs/readline-4.1:0/8= >=sys-devel/automake-1.15.1:1.15 dev-libs/libressl:0/47= virtual/libintl >=dev-db/sqlite-3.3.8:3/3= virtual/pkgconfig !<sys-devel/gettext-0.18.1.1-r3 virtual/libffi >=sys-devel/automake-1.16.1:1.16 >=dev-libs/expat-2.1 >=sys-libs/zlib-1.1.3:0/1= >=sys-devel/autoconf-2.69 >=app-eselect/eselect-python-20140125-r1 app-misc/mime-types >=sys-devel/autoconf-2.65 !!<sys-apps/portage-2.1.9 app-arch/bzip2:0/1= !sys-devel/gcc[libffi(+)] >=sys-libs/ncurses-5.2:0/6= dev-lang/python-3.7.2: >=app-portage/elt-patches-20170815 >=sys-libs/readline-4.1:0/8= >=sys-devel/automake-1.15.1:1.15 virtual/libffi:0/7= dev-libs/libressl:0/47= virtual/libintl >=dev-db/sqlite-3.3.8:3/3= app-arch/xz-utils:0/0= virtual/pkgconfig !<sys-devel/gettext-0.18.1.1-r3 >=sys-devel/automake-1.16.1:1.16 !!<sys-apps/sandbox-2.6-r1 >=dev-libs/expat-2.1:0/0= >=sys-libs/zlib-1.1.3:0/1= >=sys-devel/autoconf-2.69 >=app-eselect/eselect-python-20140125-r1 app-misc/mime-types app-arch/bzip2:0/1= !sys-devel/gcc[libffi(+)] >=sys-libs/ncurses-5.2:0/6= dev-lang/python-3.6.8: >=app-portage/elt-patches-20170815 >=sys-libs/readline-4.1:0/8= >=sys-devel/automake-1.15.1:1.15 virtual/libffi:0/7= dev-libs/libressl:0/47= virtual/libintl >=dev-db/sqlite-3.3.8:3/3= app-arch/xz-utils:0/0= virtual/pkgconfig !<sys-devel/gettext-0.18.1.1-r3 >=sys-devel/automake-1.16.1:1.16 !!<sys-apps/sandbox-2.6-r1 >=dev-libs/expat-2.1:0/0= >=sys-libs/zlib-1.1.3:0/1= >=sys-devel/autoconf-2.69 >=app-eselect/eselect-python-20140125-r1 app-misc/mime-types app-arch/bzip2:0/1= !sys-devel/gcc[libffi(+)] >=sys-libs/ncurses-5.2:0/6=
パターンで ebuild または eclass を検索する (qgrep)
qgrep を使って、ある ebuild の名前 (以下の例では"libechonest"とします) に言及している ebuild を探すことができます。これはあるパッケージに依存するすべてのパッケージを (インストールされているかどうかに関係なく) 一覧表示します:
user
$
qgrep -l libechonest
media-libs/libechonest/libechonest-2.0.2.ebuild media-libs/libechonest/libechonest-2.2.0-r1.ebuild media-libs/libechonest/libechonest-2.3.0.ebuild media-libs/libechonest/libechonest-2.3.1.ebuild media-libs/libechonest/libechonest-2.3.1-r1.ebuild media-libs/libechonest/libechonest-9999.ebuild media-sound/clementine/clementine-1.2.3.ebuild media-sound/clementine/clementine-1.2.3-r1.ebuild media-sound/clementine/clementine-1.3.1-r1.ebuild media-sound/tomahawk/tomahawk-0.8.4-r3.ebuild media-sound/tomahawk/tomahawk-9999.ebuild
-J
オプションは検索対象をインストール済みのパッケージに制限します。
-N
はファイル名の代わりにアトムを印字します。
user
$
qgrep -NJ net-print/cups
app-office/libreoffice-6.1.5.2: cups? ( net-print/cups )
dev-qt/qtprintsupport-5.11.3: cups? ( >=net-print/cups-1.4 )
net-print/hplip-3.18.6: net-print/cups
net-print/hplip-3.18.6: hpijs? ( net-print/cups-filters[foomatic] )
net-print/cups-2.2.7:PDEPEND=">=net-print/cups-filters-1.0.43"
net-print/cups-filters-1.21.6: >=net-print/cups-1.7.3
net-print/cups-filters-1.21.6: !<=net-print/cups-1.5.9999
net-wireless/bluez-5.50-r2: cups? ( net-print/cups:= )
app-text/ghostscript-gpl-9.26: cups? ( >=net-print/cups-1.3.8 )
x11-libs/gtk+-2.24.32-r1: cups? ( >=net-print/cups-1.7.1-r2:=[${MULTILIB_USEDEP}] )
x11-libs/gtk+-3.24.4-r1: cups? ( >=net-print/cups-1.2[${MULTILIB_USEDEP}] )
あるebuildに属するファイルの一覧表示 (qlist)
qlist は、指定した ebuild に属する全てのファイルの一覧を提供します。
user
$
qlist vim
/usr/bin/gvim /usr/bin/gvimdiff /usr/bin/evim /usr/bin/eview /usr/bin/gview /usr/bin/rgvim [...]
あるUSEフラグを使っているパッケージの検索 (quse)
使用している USE フラグの一覧を表示するには、 quse を実行してください。もっとも単純な形式では、与えられた USE フラグを使用する ebuild を一覧表示します。
user
$
quse firefox
app-misc/tracker/tracker-0.12.10-r1.ebuild applet doc eds elibc_glibc exif firefox-bookmarks flac flickr gif [...]
USE フラグの説明を表示するには、
-D
オプションを使うことができます。これは、アトム名を引数として取り、与えられたアトムのすべての USE フラグを一覧表示する
-p
オプションと組み合わせることができます。
user
$
quse -Dvp autogen
sys-devel/autogen-5.18.16-r1 libopts install the libopts tarball (a few packages want this for developing) static-libs Build static versions of dynamic libraries as well
パッケージサイズの検索 (qsize)
パッケージの大きさを表示させるには、 qsize アプリケーションを使用します:
user
$
qsize vim-core
app-editors/vim-core: 1846 files, 175 non-files, 28.5M [...]
ebuild リポジトリの検索 (qsearch)
app-portage/portage-utils の中で最も強力なツールの一つが qsearch です。このツールは emerge -s を実行するよりもずっと速く ebuild リポジトリを検索することができます。
いくつか使い方の例を挙げます:
user
$
qsearch terminus
media-fonts/terminus-font: A clean fixed font for the console and X11
-H
オプションを使用すると、パッケージに関するホームページの情報が表示されます:
user
$
qsearch -H terminus
media-fonts/terminus-font: http://terminus-font.sourceforge.net/
他の例として、Jabberクライアントについて見てみましょう:
user
$
qsearch -S "jabber client"
app-emacs/emacs-jabber: A Jabber client for Emacs net-im/coccinella: Jabber Client With a Built-in Whiteboard and VoIP (jingle) net-im/gajim: Jabber client written in PyGTK net-im/tkabber: A jabber client written in Tcl/Tk net-im/vacuum: Qt Crossplatform Jabber client
emergeログからの情報抽出 (qlop)
qlop は、 emerge.log ファイルから役立つ情報を抽出します。このツールはパッケージがコンパイルされた回数を推測したり、ビルド時間を他のシステムと比較したりするのに役立ちます。ある瞬間に何をコンパイルしていてどれくらい時間がかかりそうなのか、コンソール上で作業していて他の手段をとりたくないときに手軽に確認することにも使えます。
dev-lang/perl のビルド作業がどのくらいかかるか見積もりたいときには:
user
$
qlop -a perl
dev-lang/perl: 7′12″ average for 3 merges
いま何がemergeされていて、その作業に既にどのくらいの時間が経過したのか、見てみましょう:
user
$
qlop -rt
2019-12-31T03:07:16 >>> net-fs/samba: 6′19″... (82 of 85) ETA: 23s
バイナリパッケージをインストールする (qmerge)
qmerge は高速にバイナリパッケージ (binpkg) をインストールすることができます:
user
$
qmerge sys-apps/sed
[R] sys-apps/sed-4.8
バイナリパッケージを作成または操作する (qpkg)
qpkg はバイナリパッケージを作成または整理するために使用されます。
qpkg はかつてパッケージを検索するための gentoolkit コマンドでしたが、そのコマンドについての時代遅れのドキュメントをまだインターネットで見つけることができます。 equery を参照してください。
quickpkg と混同しないでください。
qsearch
- List the descriptions of every package in the cache
-
user $qsearch --all .
- Regex search package basenames
-
user $qsearch --search <regex>
- Regex search package descriptions (or homepage when using -H)
-
user $qsearch --desc <arg>
- Only show package name
-
user $qsearch --name-only <package>
- Show homepage info instead of description
-
user $qsearch --homepage gentoo.org
- Show repository the ebuild originates from
-
user $qsearch --repo gentoo
- Print matched atom using given format string
-
user $qsearch --format <arg>
- Set the ROOT env va
-
user $qsearch --root <arg>
- Report full package versions, emit more elaborate output
-
user $qsearch --verbose syslog-ng
- Tighter output; suppress warnings
-
user $qsearch --quiet <package>
- Don't output color
-
user $qsearch --nocolor package>
- Force color in output
-
メモ
Color is enabled by default. -
user $qsearch --color <package>
- Print current qsearch version
-
user $qsearch --version
quse
- Print version and exit
-
user $quse --version
- Print this help and exit
-
user $quse --help
- Force color in output
-
user $quse --color
- Don't output color
-
user $quse --nocolor
- Tighter output; suppress warnings
-
user $quse --quiet <package>
- Report full package versions, emit more elaborate output
-
user $quse --verbose <package>
- Set the ROOT env var
-
user $quse --root <arg>
- Print matched atom using given format string
-
user $quse --format <arg>
- Show repository the ebuild originates from
-
user $quse --repo
- Restrict matching to package or category
-
user $quse --package <arg>
- Only search installed packages
-
user $quse --installed
- Describe all USE flags
-
user $quse --describe .
- Use the LICENSE vs IUSE
-
メモ
Including a dot (.) will list all available licenses. -
user $quse --license .
- List all ebuilds, don't match anything
-
user $quse --all
- Show exact non regexp matching using strcmp
-
user $quse --exact useflag
トラブルシューティング
アプレットコマンドのアトムフィールドを定義する
特定の q アプレットコマンドと引数の組み合わせ (例えば
qsearch --format
) では、アトムのフォーマット記法を利用できます。フォーマット記法の定義は、qatom の man ページの
--format
(
-F
) 引数の箇所で見つけられます:
user
$
man 1 qatom
関連項目
- Portage — Gentoo のための公式の パッケージマネージャ であり、 ディストリビューションシステム です。
- Gentoolkit — Gentoo システムと、特に Portage の管理を容易にするためのツールセットです。
- Useful Portage tools — ebuild リポジトリ から入手できる Gentoo 固有の、特に Portage のための、システム管理ツールのリストを提供します。
This page is based on a document formerly found on our main website
gentoo.org
.
The following people contributed to the original document:
Åukasz Damentko,
, and Marcelo Góes
They are listed here because wiki history does not allow for any external attribution. If you edit the wiki article, please do
not
add yourself here; your contributions are recorded on each article's associated history page.