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使用方法的更多相关文章

  1. linux清除cache的方法

    1  Linux下内存占用多的原因 当linux第一次读取一个文件运行时,一份放到一片内存中cache起来,另一份放入运行程序的内存中,正常运行,当程序运行完,关闭了,cache中的那一分却没有释放, ...

  2. Ubuntu Linux系统三种方法添加本地软件库

    闲着没事教教大家以Ubuntu Linux系统三种方法添加本地软件库,ubuntu Linux使用本地软件包作为安装源——转2007-04-26 19:47新手重新系统的概率很高,每次重装系统后都要经 ...

  3. Linux 释放cache化缓存

    Linux 释放cache化缓存 free -g查看空余内存以及已使用内存 原文  https://blog.csdn.net/tomspcc/article/details/78131468 机械硬 ...

  4. 转:Linux环境变量设置方法总结 PATH、LD_LIBRARY_PATH

    转:  https://www.linuxidc.com/Linux/2017-03/142338.htm 文章写比较全  转载记录 Linux环境变量设置方法总结 PATH.LD_LIBRARY_P ...

  5. (转)Linux I/O 调度方法

    Linux I/O 调度方法 转自https://blog.csdn.net/theorytree/article/details/6259104 操作系统的调度有 CPU调度    CPU sche ...

  6. linux dentry cache 转自:http://blog.csdn.net/denzilxu/article/details/9188003

    Linux dentry cache学习 每个dentry对象都属于下列几种状态之一: (1)未使用(unused)状态:该dentry对象的引用计数d_count的值为0,但其d_inode指针仍然 ...

  7. [转帖]Linux环境变量设置方法总结 PATH、LD_LIBRARY_PATH

    Linux环境变量设置方法总结 PATH.LD_LIBRARY_PATH 2018年01月17日 21:10:26 晨至曦 阅读数 7548 https://blog.csdn.net/qq_1900 ...

  8. db2服务器linux的cache过高原因

    在线上db2数据库服务器,使用的linux操作系统(RHEL,centos),当db2数据库运行一段时间之后,操作系统的物理内存就趋近于0,同时系统的cache暴增,但是use却不高,下面是正常使用 ...

  9. 嵌入式linux应用程序移植方法总结

    嵌入式linux应用程序移植方法总结 前段时间一直在做openCapwap的移植和调试工作,现在工作已接近尾声,编写本文档对前段工作进行一个总结,分享下openCapwap移植过程中的经验和感悟.江浩 ...

  10. 1008win7与虚拟机中的linux共享文件的(详细)方法

    转自http://jingyan.baidu.com/article/ca00d56c74dde4e99eebcfd2.html 好东西一起分享 win7与虚拟机中的linux共享文件的(详细)方法 ...

随机推荐

  1. [Scikit-learn] 1.2 Dimensionality reduction - Linear and Quadratic Discriminant Analysis

    Ref: http://scikit-learn.org/stable/modules/lda_qda.html Ref: http://bluewhale.cc/2016-04-10/linear- ...

  2. poj2689Prime Distance(大区间筛素数)

    Prime Distance Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 19635   Accepted: 5273 D ...

  3. Python基础-注释-变量赋值

    一.注释 # 注释 \n 行分隔符 \ 继续上一行 '''   *** ''' 多行注释 二.基本规则 : 分开代码块(组)   头$尾 缩进块  语句代码块  用缩进深度区分 空行     用于分割 ...

  4. linux分析日志的一些常用方法

    head -n 2016_05_23_access_log |grep "/859" 显示前10000行中包含 /859 的记录 增加 |wc -l  则改为输出记录数 cat 2 ...

  5. JS中的循环---最全的循环总结

    在讲循环的之前,先知道一下循环结构的执行步骤 1.声明循环变量: 2.判断循环条件; 3.执行循环体操作: 4.更新循环变量: 5.然后循环执行2-4,直到条件不成立,跳出循环. 1while循环 v ...

  6. Jquery中attr 和 prop的区别和联系

    昨天在选择借款方类型的时候总是会出现选择要点两次的现象,比如点击公司,第一次点击选择公司,没有选中,必须在次点击才可以选中,总感觉是有点延迟加载的意思,后来审查元素, 发现是redio元素,这样的话就 ...

  7. Java 核心内容相关面试题【2】

    第一,谈谈final, finally, finalize的区别. final?修饰符(关键字)如果一个类被声明为final,意味着它不能再派生出新的子类,不能作为父类被继承.因此一个类不能既被声明为 ...

  8. 我的第一个python web开发框架(16)——产品分类管理

    产品分类管理的html页面之前忘记做了,这次附件里补上. 好了先上图 从页面效果图来看,我们需要开发列表获取接口.添加接口.单条记录获取接口.编辑接口和删除接口 对于产品分类列表,我们将使用jqgri ...

  9. fragmentTabHost 使用示例

    目前我们看微信的底部,有四个导航栏,那我们应该来怎么实现类似的导航栏呢? 在 android 4.0 的时候,推出了一个新的工具,fragmentTabHost . fragmentTabHost  ...

  10. openstack安装在虚拟机上重启之后无法启动问题

    http://www.byywee.com/page/M0/S931/931767.html 运行rejoin-stack.sh脚本的核心: exec screen -c $TOP_DIR/stack ...