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.
Canonical’s Kubernetes LTS (Long Term Support) will support FedRAMP compliance and receive at least 12…
Welcome to the Ubuntu Weekly Newsletter, Issue 878 for the week of February 2 –…
At Canonical, we firmly believe that delivering an outstanding, customer-centric support experience is impossible without…
I want to share how to install osTicket v1.14 for Ubuntu 20.04 server. osTicket written…
Now I want to share how to install WordPress on ubuntu 20.04 server. WordPress is…
Now I want to share the DNS server installation process on your Ubuntu 20.04 server.…