注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

分享,态度 ·~~

—— 十年太长,五年;如果可以回到五年前,你最想对那时候的自己说什么?

 
 
 

日志

 
 

linux中apt-cache命令的用法  

2009-03-02 16:55:19|  分类: Linux |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

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.

  评论这张
 
阅读(11018)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017