12/6/2023 0 Comments Using sudo apt upgrade command![]() You can list all available packages with the apt-cache command. The apt-cache command provides the option to check all the unmet dependencies of various available packages on your system. You may get troubled with unmet dependencies issue in Ubuntu or other Linux. ![]() I think it’s perhaps because after installing Ansible, it displays some message on the nodes. You may also check which packages are dependent on a certain package by checking the reverse dependencies with apt-cache.įrankly, I was also surprised to see that a DevOps tool like Ansible has a dependency on a funny Linux command like Cowsay. It also shows all the possible packages that can fulfill the dependency. You can check the dependencies of a package before (or even after) installing it. Check dependencies and reverse dependencies of a package It will be extremely rare for a regular Linux user to dwell this deep into package management. APT installs the version with higher priority unless the installed version is newer. The same package may have more than one version with a different priority. Specifying the package name will show whether the package is installed, which version is available from which repository and its priority.īy default, each installed package version has a priority of 100 and a non-installed package has a priority of 500. The policy option helps you debug the issue related to the preference file. This is one of the rarely used options of apt-cache command. apt-cache showpkg package_name apt-cache policy There is another option showpkg that displays information about the package name, version and its forward and reverse dependencies. You can see all kinds of details in the package metadata like name, version, developer, maintainer, repository, short and long description, package size, and even checksum. ![]() If you know the exact package name (or if you have managed to find it with the search), you can get the detailed metadata information on the package. It can also be used with -names-only flag. If you want complete details of all the matched packages, you may use the -full flag. apt-cache search -names-only package_name You can narrow down your search to look for the search term in package names only. It shows the matching package along with its short description in alphabetical order. apt-cache search package_nameīy default, it looks for the search term in both the name and description of the package. You can use a regex pattern to search for a package in the local APT cache. The most common use of apt-cache command is for finding packages. How do you do that? You use the command: sudo apt update Search for packages It is always a good idea to update the local APT cache to sync it with the remote repositories. This is why I will show only the most common and useful examples of the apt-cache command in this tutorial. However, you probably won’t need to use all of them. Like any other Linux command, there are several options available with apt-cache and you can always refer to its man page to read about them. Needless to say, the APT packaging system is used on Debian and Debian-based Linux distributions like Ubuntu, Linux Mint, elementary OS etc. For that you’ll have to use the apt-get clean command. Surprisingly, apt-cache doesn’t clear the APT cache. Which repository metadata to cache depends on the repositories added in your source list in the /etc/apt/sources.list file and additional repository files located in ls /etc/apt/ directory. The location of APT cache is /var/lib/apt/lists/ directory. I’ll show you how to use the apt-cache command with examples. ![]() You can search for the availability of a package, its version number, its dependencies among other things. With the apt-cache command, you can query this local APT cache and get relevant information. The metadata usually consists of information like the package name, version, description, dependencies, repository and developers. The apt package manager works on a local cache of package metadata.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |