linux apt-cache使用方法
apt-cache是linux下的一個apt軟件包管理工具,它可查詢apt的二進制軟件包緩存文件。APT包管理的大多數信息查詢功能都可以由apt-cache命令實現,通過apt-cache命令配合不同的子命令和參數的使用,可以實現查找,顯示軟件包信息及包依賴關系等功能.
1> apt-cache show package_name
顯示指定軟件包的信息,包括版本號,安裝狀態和包依賴關系等.
2> apt-cache search package_name
搜索軟件包,可以按關鍵字查找軟件包,通常用於查詢的關鍵字會使用軟件包的名字或軟件包的一部分.
3> apt-cache showpkg package_name
顯示軟件包的依賴關系信息.
4> apt-cache stats
顯示當前系統所使用的數據源的統計信息,用戶可以使用該命令查看數據源的相關統計信息.
5> apt-cache policy package_name
顯示軟件包的安裝狀態和版本信息.
6> apt-cache depends package_name
顯示指定軟件包所依賴的軟件包。當用戶需要了解某個軟件包依賴於其他哪些包時,可以使用apt-cache depends來查詢包依賴關系.
7> apt-cache rdepends package_name
查詢指定軟件包的反向依賴關系,即那些其他的軟件包需要依賴你所指定的軟件包做為安裝和運行的必須條件.
8>apt-cache dump
顯示緩存中的每個軟件包的簡要描述信息.
9>apt-cache unmet
顯示不符合一致性的依賴關系.
========================================================================================
【from http://www.9usb.net/200811/linux-apt-cache.html】
========================================================================================
manfile:
OPTIONS
All command line options may be set using the configuration file, the descriptions indicate the configuration option to set. For boolean
options you can override the config file by using something like -f-,--no-f, -f=no or several other variations.
-p, --pkg-cache
Select the file to store the package cache. The package cache is the primary cache used by all operations. Configuration Item:
Dir::Cache::pkgcache.
-s, --src-cache
Select the file to store the source cache. The source is used only by gencaches and it stores a parsed version of the package
information from remote sources. When building the package cache the source cache is used to avoid reparsing all of the package
files. Configuration Item: Dir::Cache::srcpkgcache.
-q, --quiet
Quiet; produces output suitable for logging, omitting progress indicators. More q′s will produce more quietness up to a maximum of 2.
You can also use -q=# to set the quietness level, overriding the configuration file. Configuration Item: quiet.
-i, --important
Print only important dependencies; for use with unmet. Causes only Depends and Pre-Depends relations to be printed. Configuration
Item: APT::Cache::Important.
-f, --full
Print full package records when searching. Configuration Item: APT::Cache::ShowFull.
-a, --all-versions
Print full records for all available versions. This is the default; to turn it off, use --no-all-versions. If --no-all-versions is
specified, only the candidate version will displayed (the one which would be selected for installation). This option is only
applicable to the show command. Configuration Item: APT::Cache::AllVersions.
-g, --generate
Perform automatic package cache regeneration, rather than use the cache as it is. This is the default; to turn it off, use --no-generate. Configuration Item: APT::Cache::Generate.
--names-only, -n
Only search on the package names, not the long descriptions. Configuration Item: APT::Cache::NamesOnly.
--all-names
Make pkgnames print all names, including virtual packages and missing dependencies. Configuration Item: APT::Cache::AllNames.
--recurse
Make depends and rdepends recursive so that all packages mentioned are printed once. Configuration Item: APT::Cache::RecurseDepends.
--installed
Limit the output of depends and rdepends to packages which are currently installed. Configuration Item: APT::Cache::Installed.
-h, --help
Show a short usage summary.
-v, --version
Show the program version.
-c, --config-file
Configuration File; Specify a configuration file to use. The program will read the default configuration file and then this
configuration file. See apt.conf(5) for syntax information.
-o, --option
Set a Configuration Option; This will set an arbitrary configuration option. The syntax is -o Foo::Bar=bar. -o and --option can be
used multiple times to set different options.
linux apt-cache使用方法