: you can type in anything below, doesnt have to match anything
yum whatprovides "me with a life"
: result of the above (some liberties taken with spacing):
Loaded plugins: fastestmirror
base | 3.6 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
(1/4): extras/7/x86_64/primary_db | 166 kB 00:00
(2/4): base/7/x86_64/group_gz | 155 kB 00:00
(3/4): updates/7/x86_64/primary_db | 9.1 MB 00:04
(4/4): base/7/x86_64/primary_db | 5.3 MB 00:05
Determining fastest mirrors
* base: mirrors.xmission.com
* extras: mirrors.xmission.com
* updates: mirrors.xmission.com
base/7/x86_64/filelists_db | 6.2 MB 00:02
extras/7/x86_64/filelists_db | 468 kB 00:00
updates/7/x86_64/filelists_db | 5.3 MB 00:01
No matches found
: the key result above is that "primary_db" files were downloaded
: filelists are downloaded EVEN IF you have keepcache=0 in your yum.conf
: note you can limit this to "primary_db.sqlite" if you really want
find /var/cache/yum -name '*.sqlite'
: if you download/install a new repo, run the exact same command again
: to get the databases for the new repo
: if you know sqlite you can stop reading here
: if not heres a sample command to dump the contents
echo 'SELECT packages.name, GROUP_CONCAT(files.name, ", ") AS files FROM files JOIN packages ON (files.pkgKey = packages.pkgKey) GROUP BY packages.name LIMIT 10;' | sqlite3 -line /var/cache/yum/x86_64/7/base/gen/primary_db.sqlite
: remove "LIMIT 10" above for the whole list
: format chosen for proof-of-concept purposes, probably can be improved a lot
7 回答
我认为您不能使用yum列出软件包的内容,但如果您的本地系统上有.rpm文件(很可能是所有已安装软件包的情况),您可以使用rpm命令列出这个包的内容如下:
如果您没有包文件(.rpm),但安装了包,请尝试以下操作:
有一个名为
yum-utils
的包,它 Build 在YUM之上,包含一个名为repoquery
的工具,可以做到这一点 .结合成一个例子:
在至少一个RH系统上,使用rpm v4.8.0,yum v3.2.29和repoquery v0.0.11,
repoquery -l rpm
不打印任何内容 .如果您遇到此问题,请尝试添加
--installed
标志:repoquery --installed -l rpm
.DNF更新:
要使用
dnf
而不是yum-utils
,请使用以下命令:示例
无需安装yum-utils,也无需知道rpm文件的位置 .
这里有几个很好的答案,所以让我提供一个可怕的答案:
百胜没有它自己的包装类型 . Yum运营并帮助管理RPM . 因此,您可以使用yum列出可用的RPM,然后运行rpm -qlp命令以查看该程序包的内容 .
目前
reopquery
已集成到dnf
和yum
中,因此输入:将列出远程存储库中的包内容(即使对于尚未安装的包)
这意味着该功能不再需要安装单独的
dnf-utils
或yum-utils
软件包,因为它现在本身就受支持 .列出已安装或本地(
*.rpm
文件)包的内容有rpm -ql
我不认为
yum
orgdnf
(不是repoquery
子命令)是可能的如果我错了,请纠正我