Several methods can be used to search for packages in Debian 10 Buster. Powerful and stable tools are available for package filtering to search for the correct package name. Debian 10 offers both command-line and graphical package managers to filter and search for packages. Synaptic is a popular tool used for GUI, but it is not good for all machines, including production servers. So, you will need to use some command-line tools to search for Debian packages.
There are several options available for searching for packages in Debian 10. This article will explore how to search for a package using the aptitude, apt-cache, dpkg, and apt package managers. All commands in this article were implemented in the Debian 10 Buster terminal. Using the utilities discussed in this article, you can search packages and show their description.
Search for Available Packages Using the aptitude Command
The aptitude is an application based on Ncurses front end for apt, runs under the terminal application. This is not already installed in Debian, Ubuntu, and other Linux based distributions. To install aptitude in Debian 10, open the terminal using the application search bar as follows:
Type the following command to install aptitude in Debian 10 Buster:
Once you have installed this tool on your system, you can search for any available package using the aptitude command in the terminal. To do this, follow the syntax below:
For example, if you want to search for all OpenSSH packages, run the command shown below:
You can also search for a package using the aptitude Ncurses user interface. Type ‘aptitude’ in the terminal and the following interface will be displayed in the window.
To search for a package, press ‘/’ and then type the package name into the search bar.
Search for Available Packages Using the apt-cache Command
In Debian 10, you can search for available packages in the Debian repository using the apt-cache command. With the apt-cache command, you can also search the DEB packages installed on your system that are not in the Debian repository. Use the following command to perform the search tasks using the apt-cache command.
The above command will display the names of packages with the expression “vim” in the description or name. To search for those packages, have the search expression in the name only. Then, enter the following command:
To view more details about the listed package, use the following command:
The aptitude and apt-cache provide similar information about the packages.
In most cases, the results will be too long. To shorten the results, you can run the following command:
You can exclude the results that do not have a specific keyword using the grep command, as follows:
The grep command is case-sensitive. To ignore the case-sensitivity, use the flag -i (grep -i search-word).
Search for Available Packages Using the apt Command
Using the apt command, you can search for all available packages. Use the following syntax to do a search using apt:
Search Available Packages Using the dpkg Command
To search for installed packages, use the dpkg command, as follows:
You can also use dpkg with grep, as follows:
This article explored how to search packages using the command-line in Debian 10, including some different methods for searching and filtering. Using these methods, you can search for Debian packages, even if you do not know about the exact package name. You can learn more about the apt-cache, grep search, aptitude, and apt commands on the Internet.