Can anyone please define what exactly the APT cache is?
Best Answer
apt-cache is a command to manipulate and obtain information from the packages at apt's cache.
It creates a repository of information about the packages that are avaiable from your sources list, so this way you can search packages and information about it.
Let's say you want to install a chat program but you don't know the name of a package for it.
You would open a console and type:
sudo apt-cache search chat
This would return a list of packages available and that refer to the word chat.
Typical operations with apt-cache:
apt-cache add
Adds a package file to the source cache.
apt-cache gencaches
Builds both the package and source cache
apt-cache showpkg
Show some general information for a single package
apt-cache stats
Show some basic statistics
apt-cache dump
Show the entire file in a terse form
apt-cache dumpavail
Print an available file to stdout
apt-cache unmet
Show unmet dependencies
apt-cache check
Check the cache a bit
apt-cache search
Search the package list for a regex pattern
apt-cache show
Show a readable record for the package
apt-cache depends
Show raw dependency information for a package
apt-cache pkgnames
List the names of all packages
apt-cache dotty
Generate package graphs for GraphVis
Don't forget to add package name after the commands listed above.
cat's primary purpose is to concatenate files. cat file1 file2 ... will show the contents of file, file2 and the others one after the other, as if the contents were in a single file. See the manpage:
NAME
cat - concatenate and print files
It is meant for usage where either:
a target command cannot read from files and you need to pass multiple files to it. An example is the tr utility. Ordinarily, with one file, you'd do:
tr < file
But with multiple files, redirection can't be used, so you have to do:
cat file1 file2 ... | tr
a target command can read from multiple files, but its behaviour may change when it's given multiple files. An example is wc, which prints the counts for each file, along with the filenames, where you might have wanted just the total, without a filename.
Remember that most commands you encounter (grep, sed, awk, sort, ...) can read files perfectly fine.
If you want to view the contents of a file, use a pager - less and more are both eminently capable of presenting files for viewing, and are far more convenient to use.
Best Answer
apt-cache
is a command to manipulate and obtain information from the packages at apt's cache.It creates a repository of information about the packages that are avaiable from your sources list, so this way you can search packages and information about it.
Let's say you want to install a chat program but you don't know the name of a package for it.
You would open a console and type:
sudo apt-cache search chat
This would return a list of packages available and that refer to the word chat.
Typical operations with
apt-cache
:Adds a package file to the source cache.
Builds both the package and source cache
Show some general information for a single package
Show some basic statistics
Show the entire file in a terse form
Print an available file to stdout
Show unmet dependencies
Check the cache a bit
Search the package list for a regex pattern
Show a readable record for the package
Show raw dependency information for a package
List the names of all packages
Generate package graphs for GraphVis
Don't forget to add package name after the commands listed above.
Source1
Source2