

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.
