2007年6月2日 星期六

讓 debian 不長一點贅肉的 debfoster

指令名稱:debfoster

簡要功能說明:去除 debian 中沒有用到的package, 以避免經過日積月累的使用後, 系統中多了一堆用不到的 package

詳細說明:各位應該都有過這種經驗, 有時安裝了某個 package, 結果由於 dependency, 裝了一大堆的 packages, 等到你覺得這個 package 不想用了, 要將之除去而後快時, apt-get 並無法將之前因為 dependency 而裝的所有 packages 給全部清乾淨, 尤其是一些 develop 的 library。而某些時候就算是知道那些 package, 但是要一一手動去刪, 也是很麻煩的。
另外, debfoster 也可拿來安裝和移除 package 用, 方便好用。
由於 debfoster 必須要知道目前系統中那些 package 是要留著, 那些要移除, 所以剛裝好時, debfoster 會問你一坨問題, 那個 package 要保留, 所以第一次是比較辛苦的, 等到全部回答完成後, 以後有安裝新的 package, 就只會問你新的 package 要不要保留, 如果不確定那是什麼東東, 可按 I or ? 來看目前這個 package 的資訊, 以確定是否移除。
debfoster 也只是 apt-get 和 dpkg 的 frontend 而已。

參數:
Command line options
-v, --verbose
debfoster will show which packages have disappeared, have become
dependencies or (if Quiet is enabled) have become orphans.

-V, --version
Display version and copyright information.

-h, --help
Display a concise summary of the available options and argument
syntax.

-f, --force
Don't ask anything and assume 'no' as the answer to all questions.
It also installs any packages that seem to be missing, thus forc-
ing your system to comply with the debfoster database. Can have
'interesting' results if you're not careful.

-q, --quiet
Don't ask anything and assume 'yes' as the answer to all ques-
tions. Useful to create an initial /var/lib/debfoster/keepers
file or to recreate it after changing the configuration file.

-m, --mark-only
Instructs debfoster to make changes to the keeper file but not to
actually install or delete any packages. This can be used to
'edit' a keeper file by invoking debfoster one or more times in a
row. The changes can then be committed by invoking debfoster with
the --force option, which will delete/install any necessary pack-
ages. This is mainly useful for scripts and frontends, but may be
useful from the command line as well.

-u, --upgrade
If used as 'debfoster -u package' it will install or upgrade the
packages specified on the command line and try to upgrade all
packages that it relies on.

-c, --config file
Specify a different configuration file to use.

-k, --keeperfile file
Specify a different debfoster database to use.

-n, --no-keeperfile
Don't read the debfoster database and start with an empty list.

-i, --ignore-default-rules
This will instruct debfoster to ignore the UseHold, UseEssential,
MaxPriority, KeepSections, and NokeepSections settings in the con-
fig file (i.e., assume that any package can be an orphan). This is
a good option for those who really want to make sure their system
is squeaky clean. It's also useful when sharing or transferring a
keeper file between multiple machines where different config files
can cause some confusion. Properly used, -i eliminates that uncer-
tainty.

-a, --show-keepers
Lists the contents of the debfoster database.

-s, --show-orphans
List all orphaned packages that are not mentioned in the debfoster
database.

-d, --show-depends package
List all packages that this package depends on.

-e, --show-dependents package
List all packages in the debfoster database that depend on this
package.

-p, --show-providers package
List all packages that provide the dependency target specified by
package (e.g. "debfoster -p x-terminal-emulator" ).

-r, --show-related package
List all packages that are only installed because this package
depends on them.

-t, --use-tasks
Make tasks visible as packages. This will make tasks that are
selectable using tasksel(1) appear as packages named task-

沒有留言: