Master Ubuntu Package Search with apt‑cache, apt, and aptitude
Learn how to locate exact package names on Ubuntu and Debian using apt‑cache, apt search, and aptitude, including updating the repository index, filtering results, viewing package details, and installing the discovered packages.
When you need to install a package but only know part of its name, Ubuntu’s apt commands require the full package name. This guide shows how to discover exact package names using apt‑cache, apt (or apt‑search), and aptitude.
Prepare the system
Before searching, refresh the local package index so the latest information is available:
$ sudo apt updateSearch with apt‑cache
apt‑cachequeries the local cache for any package whose name or description matches a keyword. It works for both installed and not‑yet‑installed packages. $ sudo apt‑cache search <keyword> Replace <keyword> with the full name, a fragment, or any word from the description. The output lists matching packages with brief summaries.
Example – find the exact name for ZFS utilities: $ apt‑cache search zfs The result includes zfsutils‑linux. To view the list page‑by‑page, pipe to less:
$ sudo apt‑cache search zfs | lessAnother example – locate a privacy‑focused meta‑search engine when you only remember its purpose: $ sudo apt‑cache search "metasearch engine" The output reveals the package name searx, which can then be installed with sudo apt install searx.
To view detailed information about a specific package, use the show flag:
$ apt‑cache show <package‑name>Alternative: apt search
The newer apt command provides a search sub‑command that highlights package names and marks installed packages. $ apt search keyword Example – search for the Apache2 web server:
$ apt search apache2Alternative: aptitude
aptitudeis a front‑end for apt that also supports searching. It may not be installed by default. $ sudo apt install aptitude After installation, search with:
$ aptitude search <keyword>Conclusion
This guide covered three ways to locate and inspect packages on Ubuntu/Debian systems: apt‑cache search, apt search, and aptitude search. By updating the package index first and using the appropriate command, you can quickly find exact package names, view their details, and install them as needed.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
ITPUB
Official ITPUB account sharing technical insights, community news, and exciting events.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
