LOGO

Find Linux Package Names - A Comprehensive Guide

September 25, 2015
Find Linux Package Names - A Comprehensive Guide

Managing Software with the Command Line in Ubuntu

The Ubuntu Software Center offers a user-friendly way to install and remove applications. However, alternative methods exist for those who prefer a keyboard-driven approach. Software can be managed directly through the command line interface.

Successfully installing or uninstalling software via the command line requires knowing the precise package name. The Advanced Packaging Tool (APT) serves as the package management system for Debian-based distributions, including Ubuntu. Within APT, the “apt-cache” program is instrumental in maintaining the package database and retrieving metadata.

NOTE: When instructed to type commands in this guide, do not include the quotation marks unless explicitly stated.

Utilizing apt-cache

To generate a comprehensive list of all available packages within the system, execute the following command at the prompt and then press “Enter”.

apt-cache pkgnames | less

The inclusion of “| less” directs the output to the “less” command. This enables navigation through the list using the up and down arrow keys for single-item scrolling, or “PgUp” and “PgDn” for page-by-page movement. Alternatively, piping the output to “more” (“| more”) allows for line-by-line advancement after the initial screen of results is displayed.

how-to-find-out-exact-package-names-for-applications-in-linux-1.jpg

The initial results will appear on the screen. Utilize the arrow keys for scrolling or “Enter” to view subsequent screens. Press “q” to exit the “less” command and return to the command prompt.

how-to-find-out-exact-package-names-for-applications-in-linux-2.jpg

If you possess partial knowledge of the package name, you can refine the search using that fragment. For instance, to list all packages beginning with “fire”, enter the following command at the prompt and press “Enter”.

apt-cache pkgnames fire

how-to-find-out-exact-package-names-for-applications-in-linux-3.jpg

All packages commencing with “fire” will be displayed. Again, the output was piped to “less” for convenient scrolling.

how-to-find-out-exact-package-names-for-applications-in-linux-4.jpg

To retrieve detailed information about a specific package – including its version number, checksums, size, installed size, and category – employ the “show” option. An example is shown below.

apt-cache show firefox

how-to-find-out-exact-package-names-for-applications-in-linux-5.jpg

A package’s dependencies are the pre-requisites that must be installed for it to function correctly. Reverse dependencies indicate which other packages rely on the given package. To examine both dependencies and reverse dependencies, utilize the “showpkg” option. For example, to view the dependencies and reverse dependencies for Firefox, type the following command at the prompt and press “Enter”.

apt-cache showpkg firefox

how-to-find-out-exact-package-names-for-applications-in-linux-6.jpg

This displays a list of packages that require Firefox to operate…

how-to-find-out-exact-package-names-for-applications-in-linux-7.jpg

…and the list of packages that Firefox itself depends on.

how-to-find-out-exact-package-names-for-applications-in-linux-8.jpg

To obtain overall statistics regarding the package cache – such as the number of different package types – use the “stats” option. Enter the following command at the prompt and press “Enter”.

apt-cache stats

how-to-find-out-exact-package-names-for-applications-in-linux-9.jpg

To discover package names alongside their corresponding descriptions, employ the “search” option. For example, to view descriptions for packages related to the GNOME Minesweeper game, type the following command at the prompt and press “Enter”.

apt-cache search gnome-mines

how-to-find-out-exact-package-names-for-applications-in-linux-10.jpg

Using axi-cache

The “axi-cache” command functions similarly to “apt-cache”, but delivers more descriptive results, arranged by relevance. As an illustration, we searched for all packages containing “fire” in their name using the following command.

axi-cache search fire

The initial 20 results are presented.

how-to-find-out-exact-package-names-for-applications-in-linux-11.jpg

To view further results, enter “axi-cache more” at the command line.

how-to-find-out-exact-package-names-for-applications-in-linux-12.jpg

The usage of “axi-cache” closely mirrors that of “apt-cache”. For comprehensive information regarding “axi-cache” usage, type “axi-cache help” at the prompt and press “Enter”.

#linux#package manager#package name#apt#yum#dnf