dpkg -L <package>
This command gives me a list of all the installed files, what's apt-get's equivalent option for it? I read the man page but couldn't figure out.
-
There is no equivalent. apt-get is a layer on top of dpkg, not a replacement of it.
From Dennis Kaarsemaker -
It doesn't exist. You can use the GUI synaptic which will show you all the installed packages.
Shown below.
From garbagecollector -
Like Dennis said,
apt-getis a layer on top ofdpkg(or other local package managers such asrpm).dpkgmanages the local packages on the machine, whileapt-getprovides a way to grab packages from distant repositories and resolve dependencies between packages that will be handed todpkg.dpkg -L <package_file>lists the files provided by a package already installed on the machine.
With apt-get, you might want to list the files that a package provides, even if it is not installed in your system. Fortunately for you, there is a tool for that, called
apt-file, which needs to be installed in addition toapt-get. You can use it this way:# Install apt-file $ sudo apt-get install apt-file # update apt-file's cache (different than apt-get's, namely apt-cache) $ sudo apt-file update # display the contents of a package $ sudo apt-file list <package_name>Note that
apt-fileuses special files on the package repository called Contents files. While all official repositories have these files, some third-party repositories might not have them, soapt-filewon't be able to list the contents of packages on these repositories.man apt-filewill also list other nice things you can do with
apt-file, such asapt-file search <keyword>which lets you find which packages provide a given file.From Raphink -
apt-cachecan be used for some stuff you might want to do:Actually listing all packages:
To actually list all packages that is inapt-get's cache, useapt-cache pkgnames. This is very much the equivalent ofdpkg -lforapt-get, except it only shows package names, and not any other information thatdpkgmight show.NOTE: Using
apt-cache pkgnameswill generate incredibly much output, on my system it is as much as 39553 lines. To see in advance how many lines it would be on your system, try usingapt-cache stats(see below).Searching:
Useapt-cache search <regex> [<regex> [...]]where<regex>is one or more regular expressions to search for.Counting:
Useapt-cache statsto show some statistics about that cache since lastapt-get update.
For instance, an example output might be:Total package names: 39553 (1,582k) Normal packages: 30033 Pure virtual packages: 511 Single virtual packages: 2762 Mixed virtual packages: 305 Missing: 5942 Total distinct versions: 32378 (1,813k) Total distinct descriptions: 32378 (777k) Total dependencies: 210651 (5,898k) Total ver/file relations: 34931 (559k) Total Desc/File relations: 32378 (518k) Total Provides mappings: 5816 (116k) Total globbed strings: 169 (2,278) Total dependency version space: 1,052k Total slack space: 73.4k Total space accounted for: 10.0MFrom Frxstrem
0 comments:
Post a Comment