As stated before, Ubuntu is an open-source operating system. That means it has various third-party applications developed by the community to aid in various problems we may face in day-to-day life. One such problem may be package detection. These packages can be detected via tools like Synaptic package manager. However, the most commonly used are apt and apt-get commands.
First and foremost, we distinguish between apt, aptitude, and apt-get commands. Both deal with linking the Debian management system to the available online repositories. We can think of aptitude as a neural center that is used when we need to see a detailed view of all the packages on our system. APT (Advanced Packaging Tool) is the main command for installing, removing, or managing packages. A package manager embodies various apt commands like apt-get, apt show, apt-cache, etc.
To list the packages available on our system, we type in the following command.
As shown below, we can filter out a class of packages by adding certain modifications to our list command.
We may come across a warning stating: WARNING: apt does not have a stable CLI interface. Use caution in scripts.
The warning dictates the variable nature of apt, which is not happening any time soon. So it is not a big deal.
However, we can instead type if we wish to be on the safe side without the warning appearing.
Which deals with the on-disk installation like on windows.
The command illustrated above shows us the installed packages and additional packages that can be installed. However, we can type if we only wish to view the packages installed on your system.
We can look up if a certain package is installed on our system or not by using the following command.
The commands mentioned above clearly show that acpid is installed. In the second case, the listing was done; however, we did not find the desired package. That means the package is unavailable on our list and will have to be installed via the main package repository.
When a package is installed, we can clearly see the “[installed]” on the same lines as the package names on the terminal, as shown in the images above.
To list packages in a pattern, we can use the following set of commands.
$ apt list ‘sort’ or
$ dpkg –list ‘sort’
Here “ii” indicates installed packages, whereas “un” indicates uninstalled packages.
To sort packages according to the date and time of installation, we simply issue the following command.
If we want to look for all packages pertaining to a particular keyword, we use the following instruction.
Or
We may encounter several problems while locating the desired package. These include problems regarding package location or version issues. We will address them one by one.
Unable to locate package error. This error occurs when we download a package that can’t be located. This is the most common error encountered that may arise for several reasons and hamper your installation.
Then run.
In the window that appears, check all boxes, and in the “download from” section, select the main server. Then close.
Afterward, we get a warning window. We click the “reload” option to generate the sources.list file.
After the software cache refreshes, your issue should be resolved ad the package will be downloaded.
As we can see, the package causing the error is now successfully downloaded.
Your Linux version has reached its limit. In case your version is obsolete and not supported, we can use third-party versions or snap versions of packages to run desired applications.
In this article, we went through the stages of package location and how to tackle the problems that may arise during the process. We hope we could clear your queries and your issue has been resolved successfully.
This article was adapted from its original version on NixCraft. Sed is an acronym for…
You’ve recently installed VMware Workstation on your Ubuntu system and encountered the frustrating “Could not…
Have you ever found yourself staring at a terminal full of 404 errors while trying…
One particularly frustrating error that many users face when trying to upgrade from Ubuntu 18.04 …
In the world of containerization, time synchronization issues can create unexpected roadblocks when working with…
If you’ve recently upgraded to Ubuntu 23.04 or newer, you might have encountered a frustrating…