This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.
Please visit our production wiki at https://wiki.gentoo.org
eclean/ja
Warning: Display title "eclean/ja" overrides earlier display title "Eclean".
eclean は、リポジトリのソースファイルやバイナリパッケージを削除するツールです。 app-portage/gentoolkit パッケージの一部であり、 Portage-Tools プロジェクト が担当しています。
インストール
Emerge
eclean をインストールするには:
root #
emerge --ask app-portage/gentoolkit
使い方
Portage は、ソースファイルを /usr/portage/distfiles 、バイナリパッケージを /usr/portage/packages に保存するのがデフォルトです。この保存場所は、/etc/portage/make.conf 内の DISTDIR や PKGDIR の環境変数を変更することで、変更可能です。どちらの保存場所も、定期的に掃除しなければ非常に巨大になります。そのため、 eclean が作られました。
呼び出し
eclean --help を実行すれば、全ての処理に関する概要と、オプションのリストと、使い方の説明が表示されます。
user $
eclean --help
Usage: eclean [global-option] ... <action> [action-option] ... eclean-dist [global-option, distfiles-option] ... eclean-pkg [global-option, packages-option] ... eclean(-dist,-pkg) [--help, --version] Available global options: -C, --nocolor - turn off colors on output -d, --deep - only keep the minimum for a reinstallation -e, --exclude-file=<path> - path to the exclusion file -i, --interactive - ask confirmation before deletions -n, --package-names - protect all versions (when --deep -p, --pretend - only display what would be cleaned -q, --quiet - be as quiet as possible -t, --time-limit=<time> - don't delete files modified since <time> <time> is a duration: "1y" is "one year", "2w" is "two weeks", etc. Units are: y (years), m (months), w (weeks), d (days) and h (hours). -h, --help - display the help screen -V, --version - display version info Available actions: packages - clean outdated binary packages from PKGDIR distfiles - clean outdated packages sources files from DISTDIR Available options for the packages action: NONE :) Available options for the distfiles action: -f, --fetch-restricted - protect fetch-restricted files (when --deep) -s, --size-limit=<size> - don't delete distfiles bigger than <size> <size> is a size specification: "10M" is "ten megabytes", "200K" is "two hundreds kilobytes", etc. Units are: G, M, K and B. More detailed instruction can be found in `man eclean`
distfiles の削除
コマンドに distfiles
を与えると、ソースファイルのディレクトリに処理が行われます:
root #
eclean distfiles
より短くは、以下のコマンドでも同じです:
root #
eclean-dist
バイナリパッケージの削除
バイナリパッケージを含むディレクトリに対しては、代わりに、以下を実行:
root #
eclean packages
より短くは、以下のコマンドでも同じです:
root #
eclean-pkg
オプション
デフォルトでは、現在のリポジトリ内のebuild ファイルに関するあらゆるソースファイルもバイナリパッケージも、削除されることはありません。なぜならば、現在のリポジトリツリーにあるパッケージについては、ダウングレードされたり、以前にアンインストールしたものでも再インストールされたりする可能性があり、役に立つかもしれないからです。
例えば、 foo-1.0 および foo-1.1 というパッケージがリポジトリ内にあるとします。foo-1.0 から foo-1.1 にアップグレードした後に eclean distfiles を実行しても、どちらのソースファイルも削除されません。なぜなら、foo-1.1 に不具合が見つかる可能性もあり、ユーザーが foo-1.0 を再インストールするかもしれないので、その際に再ダウンロードすることを省けるからです。
以前にアンインストールしたパッケージについても同様のことがいえます。(バージョンが何であれ) foo というパッケージがインストールされていたとします。このパッケージを(あやまって)アンインストールしてしまい、しかも eclean distfiles も実行していても、foo のソースファイルが残っていれば、再ダウンロードすることなく再インストール可能ですね。
上記の例は、バイナリパッケージを処理する際にも当てはまります。
ディスク領域をさらに節約したいのならば、 --deep
オプションを使用します。そうすると、現在インストールされているパッケージおよびバージョンに一致するものを除いて、あらゆるソースファイルやバイナリパッケージが削除されます。これを実行すると、ダウングレードや、以前アンインストールしたパッケージの再インストールの必要が生じた際には、利便が無くなることに留意してください。
また、 --deep
と --package-names
の両方のオプションを使用する方法があります。現在インストールされているパッケージ(バージョンを問わない)に一致するソースコードやバイナリパッケージを保持し、その他を削除します。この方法では、パッケージをダウングレードする際には問題ありませんが、それでも、アンインストールしたパッケージを再インストールする際には再ダウンロードが必要です。
詳しくは eclean(1) のマニュアルページを読んでください:
user $
man 1 eclean