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”.
For more complex searches, a more powerful tool such as aptitude
is required. aptitude
allows you to search according to a logical expression based on the package's meta-data fields. For instance, the following command searches for packages whose name contains iso
, whose description contains cd
and whose maintainer's name contains joerg
:
$ aptitude search iso~dcd~mjoerg
p genisoimage - Creates ISO-9660 CD-ROM filesystem images
$ aptitude show evince
Package: genisoimage
Version: 9:1.1.11-3.4
State: not installed
Priority: optional
Section: otherosfs
Maintainer: Joerg Jaspert <joerg@debian.org>
Architecture: amd64
Uncompressed Size: 1698 k
Depends: libbz2-1.0, libc6 (>= 2.33), libmagic1 (>= 5.12), zlib1g (>= 1:1.1.4)
Suggests: wodim, cdrkit-doc
Conflicts: mkhybrid, mkisofs
Replaces: mkisofs
Provides: mkisofs
Description: Creates ISO-9660 CD-ROM filesystem images
genisoimage is a pre-mastering program for creating ISO-9660 CD-ROM filesystem
images, which can then be written to CD or DVD media using the wodim program.
genisoimage includes support for making bootable "El Torito" CDs, as well as
CDs with support for the Macintosh HFS filesystem.
The package also includes extra tools useful for working with ISO images:
* mkzftree - create ISO-9660 image with compressed contents
* dirsplit - easily separate large directory contents into disks of predefined size
* geteltorito - extract an El Torito boot image from a CD image
Please install cdrkit-doc if you want most of the documentation and README files.
Tags: hardware::storage, hardware::storage:cd, hardware::storage:dvd,
interface::commandline, role::program, scope::utility, use::storing,
works-with-format::iso9660, works-with::archive
The search only returns one package, genisoimage, which satisfies all three criteria.
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 genisoimage above, the package's tags indicate that it is a storage- and more precisely CD- and DVD-related command-line utility to work with ISO9660 file-systems.
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:
Selecting the works-with::video
and use::editing
tags yields a handful of packages, including the shotcut and pitivi video editors. This system of classification is bound to be used more and more as time goes on, and package managers will gradually provide efficient search interfaces based on it.
در نتیجه، بهترین ابزار برای اینکار بستگی به پیچدگی جستجو مورد نظر شما دارد:
apt-cache
تنها اجازه جستجو در نام و توضیحات بسته را میدهد، که برای یافتن بستهای خاص با دانستن اطلاعات آن بسیار کاربردی است؛
زمانی که شرایط جستجو شامل روابط بین بستهها و meta-data آنها شود، synaptic
کاربردیتر خواهد بود؛
زمانی که جستجو بر اساس برچسب مورد نیاز باشد، یک ابزار خوب packagesearch
است، رایط گرافیکی که امکان جستجو بر اساس برچسبها و موارد دیگر را فراهم میکند (مانند نام فایلی که آن را در بر دارد). برای استفاده در خط فرمان، axi-cache
انتخاب مناسبی است.
در نهایت، زمانی که جستجو شامل عبارتهای پیچیده و عملگرهای منطقی باشد، ابزار مورد انتخاب، الگوی جستجو در aptitude
است که با وجود عجیب بودنش بسیار قدرتمند است؛ در هر دو حالت خط فرمان و تعاملی نیز کار میکند.