To install a package, knowing the exact name of the package is necessary.
Such as to install apache in Ubuntu, you can not use
sudo apt install apache. You will have to specify the
apache2 instead of plain
And I have encountered many errors like this and that's why I came up with this guide so you don't have to.
How to search packages in Ubuntu
The basic syntax to search packages using apt search is as follows:
apt search package_name
For example, here, I am looking for a package named Nala, an apt frontend. So I will be using the following command:
apt search nala
But by default, the apt will search for the keyword in the package name and description.
So it gets unnecessary packages included in search queries.
And in that case, you can use the
apt search --names-only package_name
As you can see, the search results are cut in half making it easy to find the necessary package.
Once you know the name of the package, you can the traditional
sudo apt install to install a package:
sudo apt install package_name
It's that easy!
But what if you want to know additional information about the package? Well, I've got you covered!
Get additional information about the package in Ubuntu
By default, the apt search command gets you a brief description of the package but if you want to know more, you can use the
apt show package_name
While there is a huge list, I find the listing of the following to be crucial:
- Package version
- Download and installed size
This was a quick tutorial on how you can search packages using apt. And if you want to have more options to search packages, you can use apt-cache on Ubuntu and Debian-based distros.
For queries and suggestions, feel free to leave comments.