I want to know where the database files searched by apt-file are stored.
apt-file search /usr/bin/lshw-gtk
But I don't see any files shown by strace look like apt-file database files. Why is it so?
I see it says the apt-file files are stored at /var/cache/apt/archives/
below. Is it too slow to search so many deb files? Does apt-file use some cache file to speed up the search?
$ time apt-file search /usr/bin/lshw-gtk
lshw-gtk: /usr/bin/lshw-gtk
real 0m0.542s
user 0m0.361s
sys 0m0.358s
Where are apt-get files stored?
$ strace -e trace=open,openat apt-file search /usr/bin/lshw-gtk
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libcrypt.so.1", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/dev/urandom", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/bin/apt-file", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/perl-base/strict.pm", O_RDONLY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/perl-base/warnings.pm", O_RDONLY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/perl-base/constant.pm", O_RDONLY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/perl-base/warnings/register.pm", O_RDONLY|O_CLOEXEC) = 5
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/perl-base/Getopt/Long.pm", O_RDONLY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/perl-base/vars.pm", O_RDONLY|O_CLOEXEC) = 5
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/perl-base/Exporter.pm", O_RDONLY|O_CLOEXEC) = 5
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/perl-base/overload.pm", O_RDONLY|O_CLOEXEC) = 5
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/perl-base/overloading.pm", O_RDONLY|O_CLOEXEC) = 6
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/perl-base/Exporter/Heavy.pm", O_RDONLY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/perl-base/File/Basename.pm", O_RDONLY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/perl5/5.32/AptPkg/Config.pm", O_RDONLY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/perl5/5.32/AptPkg.pm", O_RDONLY|O_CLOEXEC) = 5
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/perl-base/DynaLoader.pm", O_RDONLY|O_CLOEXEC) = 5
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/perl-base/Config.pm", O_RDONLY|O_CLOEXEC) = 6
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/perl5/5.32/auto/AptPkg/AptPkg.so", O_RDONLY|O_CLOEXEC) = 5
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 5
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libapt-pkg.so.6.0", O_RDONLY|O_CLOEXEC) = 5
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 5
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 5
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libresolv.so.2", O_RDONLY|O_CLOEXEC) = 5
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libz.so.1", O_RDONLY|O_CLOEXEC) = 5
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libbz2.so.1.0", O_RDONLY|O_CLOEXEC) = 5
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/liblzma.so.5", O_RDONLY|O_CLOEXEC) = 5
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/liblz4.so.1", O_RDONLY|O_CLOEXEC) = 5
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libzstd.so.1", O_RDONLY|O_CLOEXEC) = 5
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libudev.so.1", O_RDONLY|O_CLOEXEC) = 5
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libsystemd.so.0", O_RDONLY|O_CLOEXEC) = 5
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libgcrypt.so.20", O_RDONLY|O_CLOEXEC) = 5
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libxxhash.so.0", O_RDONLY|O_CLOEXEC) = 5
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/librt.so.1", O_RDONLY|O_CLOEXEC) = 5
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libgpg-error.so.0", O_RDONLY|O_CLOEXEC) = 5
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/perl5/5.32/AptPkg/hash.pm", O_RDONLY|O_CLOEXEC) = 5
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/perl-base/Scalar/Util.pm", O_RDONLY|O_CLOEXEC) = 6
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/perl-base/List/Util.pm", O_RDONLY|O_CLOEXEC) = 6
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/perl-base/XSLoader.pm", O_RDONLY|O_CLOEXEC) = 6
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/perl-base/auto/List/Util/Util.so", O_RDONLY|O_CLOEXEC) = 6
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/perl-base/Carp.pm", O_RDONLY|O_CLOEXEC) = 5
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/perl/5.32/Time/HiRes.pm", O_RDONLY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/perl/5.32/auto/Time/HiRes/HiRes.so", O_RDONLY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache", O_RDONLY) = 4
openat(AT_FDCWD, "/etc/apt/apt.conf.d/", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 4
openat(AT_FDCWD, "/etc/apt/apt.conf.d/00CDMountPoint", O_RDONLY|O_NOCTTY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/etc/apt/apt.conf.d/00aptitude", O_RDONLY|O_NOCTTY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/etc/apt/apt.conf.d/00trustcdrom", O_RDONLY|O_NOCTTY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/etc/apt/apt.conf.d/01autoremove", O_RDONLY|O_NOCTTY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/etc/apt/apt.conf.d/01autoremove-kernels", O_RDONLY|O_NOCTTY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/etc/apt/apt.conf.d/01autoremove-postgresql", O_RDONLY|O_NOCTTY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/etc/apt/apt.conf.d/50apt-file.conf", O_RDONLY|O_NOCTTY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/etc/apt/apt.conf.d/50command-not-found", O_RDONLY|O_NOCTTY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/etc/apt/apt.conf.d/50kali", O_RDONLY|O_NOCTTY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/etc/apt/apt.conf.d/70debconf", O_RDONLY|O_NOCTTY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/etc/apt/apt.conf.d/80debtags", O_RDONLY|O_NOCTTY|O_CLOEXEC) = 4
Finding relevant cache files to search ...--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=36892, si_uid=504, si_status=0, si_utime=0, si_stime=1} ---
Searching through filenames ...--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=36895, si_uid=504, si_status=0, si_utime=0, si_stime=0} ---
lshw-gtk: /usr/bin/lshw-gtk
+++ exited with 0 +++
The
apt-file
parses*Contents*.lz4
files from/var/lib/apt/lists
.For details see:
/etc/apt/apt.conf.d/50apt-file.conf
;man apt-file
locally or online;