{{Header}}
{{Title|
title=apt-file
}}
{{#seo:
|description=HowTo: install apt-file. It an be used to show which files are being included by a package.
|image=Aptfiles1614223640.jpg
}}
[[File:Aptfiles1614223640.jpg|thumb]]
{{intro|
HowTo: install apt-file. It an be used to show which files are being included by a package.
}}
= Introduction =
<code>apt-file</code> an be used to show which files are being included by a package.

Quote Debian package [https://packages.debian.org/{{Stable project version based on Debian codename}}/apt-file <code>apt-file</code>]:

<blockquote>search for files within Debian packages (command-line interface)

apt-file is a command line tool for searching files contained in packages for the APT packaging system. You can search in which package a file is included or list the contents of a package without installing or fetching it.</blockquote>

= Installation =

The order in which these commands are run matter, <ref>
Also <code>apt update</code> cannot be skipped since package contents files need to be downloaded.
</ref> but the process is idempotent. This means it is possible to re-apply all of the following steps.

{{Box|text=
'''1.''' Delete [https://github.com/Whonix/usability-misc/blob/master/etc/apt/apt.conf.d/30usability-misc <code>/etc/apt/apt.conf.d/30usability-misc</code>] because it contains settings that [https://forums.whonix.org/t/speeding-up-apt-update-with-acquire-languages-none-and-contents-deb-defaultenabled-false-its-so-much-faster/8894 speed up APT] but break <code>apt-file</code> and <code>command-not-found</code>. <ref>
<pre>
Acquire::IndexTargets::deb::Contents-deb::DefaultEnabled false;
</pre>

breaks <code>apt-file</code> because it requires <code>/var/lib/apt/lists/*Contents*</code> to exist.

See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=857090
</ref>

{{CodeSelect|code=
sudo rm -f /etc/apt/apt.conf.d/30usability-misc
}}

'''2.''' Install <code>apt-file</code>.

{{Install Package|
package=apt-file
}}

'''3.''' Run <code>apt-file update</code> with root rights.

{{CodeSelect|code=
sudo apt-file update
}}

'''4.''' Done.

Setup of <code>apt-file</code> has been completed.
}}

= Usage =
Syntax:

{{CodeSelect|code=
sudo apt-file list package-name
}}

Example:

{{CodeSelect|code=
sudo apt-file list nano
}}

= See Also =

* [[command-not-found|<code>command-not-found</code>]]
* [https://forums.whonix.org/t/speeding-up-apt-update-with-acquire-languages-none-and-contents-deb-defaultenabled-false-its-so-much-faster/8894 Speeding up "apt update" with Acquire::Languages=none and Contents-deb::DefaultEnabled=false - It's so much faster!]

= Footnotes =
{{reflist|close=1}}
[[Category:Documentation]]
{{Footer}}