Emerge
emergeとは、Gentoo Linuxのパッケージ管理システムPortageのCUIフロントエンドである。
emergeとは、Gentoo Linuxのパッケージ管理システムPortageのCUIフロントエンドである。
概要
Gentoo Linuxはパッケージをインストールまたはアップグレードする際にソースコードをダウンロードして、ローカルでソースコードの設定とコンパイルを行い、所定のディレクトリにインストールする。その際にebuildと呼ばれるスクリプトを参照する。この一連の流れを実行するために提供されるフロントエンドがemergeである。
使用例
ここに表示されている全てのコマンドで、ログの量を増やす "-v" (--verbose) オプションを使用できる。
システムのアップデート
システムをアップデートする場合はまず、インターネット上のパッケージリポジトリに問い合わせる。その場合、
emerge --sync
を実行して、パッケージリポジトリから ebuild のダウンロードを行う。しかし、このコマンドはシステムにある ebuild との差分を確認してダウンロードを行うため、システムを長い間更新していない場合は時間がかかる。その場合、
emerge-webrsync
コマンドを実行して、最新のスナップショット全体をダウンロードする。その次に、システム全体をアップグレードする場合、
emerge -uD --with-bdeps=y @world
を実行して、ソースのダウンロード、コンパイル、そしてインストールを自動で行う。
"-uD --with-bdeps" はオプションで、操作の内容であり、"@world" はユーザーが明示的に指定した "/var/lib/portage/world" に書かれているパッケージを示し、実行対象である。"@world" の内容は、そのファイルを編集することで変更することができる。"-u" はアップデートを行うオプションであり、単独で使用すると "@world" の依存関係のみを考慮してアップデート、"-d" は "@world" 内に記述されていない依存関係でインストールされたパッケージの依存関係も考慮してアップデートするオプションである。 "--with-bdeps=y" は、”ビルド時依存”と呼ばれ、パッケージのコンパイルやビルド時に必要だが、パッケージのインストール後には不要になるパッケージを更新するためのオプションである。
ちなみに、"u" は "--update"、"-D" は "--deep"と省略せずに、置き換えて記述できるオプションである。省略せずに記述する場合、
emerge --update --deep --with-bdeps=y @world
となる。上記のコマンドと実行内容は同じである。
emergeコマンドは、"-p" (--pretend) オプションで実行する操作を表示、"-a" (--ask) オプションで実行する操作を表示した後、実行をするかどうか選択できる。
システム全体に適用されているUSEフラグの変更
"/etc/portage/make.conf" を編集した場合、
emerge -DN @world
と実行し、変更を適用する。省略せずに書くと、
emerge --deep --newuse @world
となる。ただ、ほぼ同じ操作をするものに次のようなものがある。
emerge -DU @world
"-U"は、"--changed-use" というオプションであり、"--update" とは別のオプションである。"-N" を "-U" に置き換えると、ユーザーが有効にしていないUSEフラグの変更によるパッケージのリビルドを含めずにシステムを更新できる。このコマンドも同じく、
emerge --deep --changed-use @world
と置き換えることができる。
システムのクリーンアップ
システムをクリーンアップするためには、
emerge -c
と実行する。このコマンドは、"@world" の依存関係にない孤立したすべてのパッケージを削除するため、
emerge -pc
または
emerge -ac
とオプションを付けてユーザーの再確認なしでコマンドが実行されないようにすることを推奨する。
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.