With the large and ever-growing amount of software in Debian, there emerges a paradox: Debian usually has a tool for most tasks, but that tool can be very difficult to find among the myriad other packages. The lack of appropriate ways to search for (and to find) the right tool has long been a problem. Fortunately, this problem has almost entirely been solved.
مختصرترین شیوه جستجو استفاده از نام دقیق بسته است. اگر apt show package نتیجهای بازگرداند، آنگاه بسته موجود است. متاسفانه، این امر مستلزم دانستن یا حدس زدن نام بسته است، که همیشه مقدور نیست.
A slightly more successful searching pattern is a plain-text search in package names, but it remains very limited. You can generally find results by searching package descriptions: since each package has a more or less detailed description in addition to its package name, a keyword search in these descriptions will often be useful.
apt-cache and
axi-cache are the tools of choice for this kind of search (see
گزینههای جایگزین axi-cache); for instance,
apt-cache search video will return a list of all packages whose name or description contains the keyword “video”.
برای جستجوهای پیشرفتهتر، ابزار پیشرفتهتری مانند aptitude مورد نیاز است. aptitude اجازه جستجو منطقی در تمام فیلدهای meta-data را میدهد. برای نمونه، دستور زیر به جستجوی بستههایی میپردازد که نامشان شامل kino، توضیحشان شامل video و نام نگهدارندهاش شامل paul باشد:
$ aptitude search kino~dvideo~mpaul
p kino - Non-linear editor for Digital Video data
$ aptitude show kino
Package: kino
Version: 1.3.4+dfsg0-1.1
State: not installed
Priority: optional
Section: video
Maintainer: Paul Brossier <[email protected]>
Architecture: amd64
Uncompressed Size: 8,316 k
Depends: libasound2 (>= 1.0.16), libavc1394-0 (>= 0.5.3), libavcodec58 (>= 7:4.2),
libavformat58 (>= 7:4.2), libavutil56 (>= 7:4.0), libc6 (>= 2.29), libdv4
(>= 1.0.0), libgcc-s1 (>= 3.0), libgdk-pixbuf-2.0-0 (>= 2.22.0),
libglade2-0 (>= 1:2.6.4-2~), libglib2.0-0 (>= 2.12.0), libgtk2.0-0 (>=
2.24.0), libiec61883-0 (>= 1.2.0), libpango-1.0-0 (>= 1.14.0),
libpangoft2-1.0-0 (>= 1.14.0), libquicktime2 (>= 2:1.2.2), libraw1394-11
(>= 2.1.2), libsamplerate0 (>= 0.1.7), libstdc++6 (>= 9), libswscale5 (>=
7:4.0), libx11-6, libxext6, libxml2 (>= 2.7.4), libxv1
Recommends: ffmpeg, curl
Suggests: udev | hotplug, vorbis-tools, sox, mjpegtools, lame, ffmpeg2theora
Conflicts: kino-dvtitler, kino-timfx, kinoplus, kino-dvtitler:i386,
kino-timfx:i386, kinoplus:i386, kino:i386
Replaces: kino-dvtitler, kino-timfx, kinoplus, kino-dvtitler:i386,
kino-timfx:i386, kinoplus:i386
Provides: kino-dvtitler, kino-timfx, kinoplus
Description: Non-linear editor for Digital Video data
Kino allows you to record, create, edit, and play movies recorded with DV
camcorders. This program uses many keyboard commands for fast navigating and
editing inside the movie.
The kino-timfx, kino-dvtitler and kinoplus sets of plugins, formerly distributed
as separate packages, are now provided with Kino.
Homepage: http://www.kinodv.org/
Tags: field::arts, hardware::camera, implemented-in::c, implemented-in::c++,
interface::graphical, interface::x11, role::program, scope::application,
suite::gnome, uitoolkit::gtk, use::editing, use::learning,
works-with::video, x11::application
جستجو تنها یک نتیجه بازگرداند، kino که با تمام شرایط فوق سازگار بود.
Even these multi-criteria searches are rather unwieldy, which explains why they are not used as much as they could. A new tagging system has therefore been developed, and it provides a new approach to searching. Packages are given tags that provide a thematic classification along several strands, known as a “facet-based classification”. In the case of kino above, the package's tags indicate that Kino is a Gnome-based software that works on video data and whose main purpose is editing.
Browsing this classification can help you to search for a package which corresponds to known needs; even if it returns a (moderate) number of hits, the rest of the search can be done manually. To do that, you can use the
~G search pattern in
aptitude, but it is probably easier to simply navigate the site where tags are managed or use the
debtags command:
انتخاب works-with::video و use::editing منجر به جستجو بستههای مرتبط میگردد، که شامل kino و pitivi نیز میشود. این سیستم طبقهبندی روز به روز بیشتر مورد استفاده قرار میگیرد و مدیر بستهها نیز به مرور رابطهای جستجوی کاربردیتری را برای آن فراهم میکنند.
در نتیجه، بهترین ابزار برای اینکار بستگی به پیچدگی جستجو مورد نظر شما دارد:
apt-cache تنها اجازه جستجو در نام و توضیحات بسته را میدهد، که برای یافتن بستهای خاص با دانستن اطلاعات آن بسیار کاربردی است؛
زمانی که شرایط جستجو شامل روابط بین بستهها و meta-data آنها شود، synaptic کاربردیتر خواهد بود؛
زمانی که جستجو بر اساس برچسب مورد نیاز باشد، یک ابزار خوب packagesearch است، رایط گرافیکی که امکان جستجو بر اساس برچسبها و موارد دیگر را فراهم میکند (مانند نام فایلی که آن را در بر دارد). برای استفاده در خط فرمان، axi-cache انتخاب مناسبی است.
در نهایت، زمانی که جستجو شامل عبارتهای پیچیده و عملگرهای منطقی باشد، ابزار مورد انتخاب، الگوی جستجو در aptitude است که با وجود عجیب بودنش بسیار قدرتمند است؛ در هر دو حالت خط فرمان و تعاملی نیز کار میکند.