我对APT软件包管理器有一些疑问。
据我了解,我们的存储库网址位于/etc/apt/sources.list
和/etc/apt/sources.list.d/*
当apt-get update
被调用时,容易尝试连接到那些什么程序都可以等库文件,下载信息,所有指定的仓库。
它在本地缓存所有检索到的数据,以便以后使用而无需向存储库发出Internet请求。
当apt-get install
把它叫做搜索从版本库的本地缓存包列表,如果包装没有发现它什么都不做,除了显示一个错误。
apt-get search
还调查本地缓存,并且不向互联网发出任何请求。
我对吗?我不确定发出请求而不是在本地缓存中搜索数据的命令。
另外,apt-cache search
和之间有什么区别apt search
?我猜他们都使用本地缓存。
正确的是apt-get update
从源(在线)和其他命令中读取apt-get search
并apt-get install
从缓存的信息中读取。来自man apt
:
update (apt-get(8))
update is used to download package information from all configured
sources. Other commands operate on this data to e.g. perform
package upgrades or search in and display details about all
packages available for installation.
apt search <package>
和之间的区别apt-cache search <package>
是,apt search
apt的输出更奇特(具有按字母顺序排列的颜色,具有很好的行间距,易于阅读),因为apt是一种新颖的界面。这个答案很好地解释了apt和apt-get之间的区别
但是,搜索并不是您可以使用apt-cache唯一要做的事情:
Usage: apt-cache [options] command
apt-cache [options] show pkg1 [pkg2 ...]
apt-cache queries and displays available information about installed
and installable packages. It works exclusively on the data acquired
into the local cache via the 'update' command of e.g. apt-get. The
displayed information may therefore be outdated if the last update was
too long ago, but in exchange apt-cache works independently of the
availability of the configured sources (e.g. offline).
Most used commands:
showsrc - Show source records
search - Search the package list for a regex pattern
depends - Show raw dependency information for a package
rdepends - Show reverse dependency information for a package
show - Show a readable record for the package
pkgnames - List the names of all packages in the system
policy - Show policy settings
这是从info
页面apt-cache
apt
联合命令,从apt-get
和apt-cache
,这样你就可以得到相同或略有票友/从任何的收拾输出apt-cache [option] <package>
与命令apt [option] <package>
如
apt show gimp
显示几乎与
apt-cache show gimp
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句