{"id":4639,"date":"2014-11-28T09:44:56","date_gmt":"2014-11-28T09:44:56","guid":{"rendered":"https:\/\/bodhost.com\/kb\/?p=4639"},"modified":"2026-02-26T14:04:31","modified_gmt":"2026-02-26T14:04:31","slug":"apt-file-to-explore-the-debian-packages","status":"publish","type":"post","link":"https:\/\/www.bodhost.com\/kb\/apt-file-to-explore-the-debian-packages\/","title":{"rendered":"Explore the Debian Packages with Apt-file"},"content":{"rendered":"\n<p>Apt-file to explore the Debian packages: when one uses only the command line on Linux, there are tools to have in your pocket, so apt-file for exploring the Debian packages (.deb) and finding a package according to a file. Here, we are going to see how to use it:<\/p>\n\n\n\n<p>First, we will see the installation and preparation of apt-file: Apt-file simply installed on Debian via deposits, it will capture the following command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt-get install apt-file<\/pre>\n\n\n\n<p>It will then prepare apt-file to be used in fulfilling its cache; this requires a simple command line that I\u2019ve mentioned below:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt-file update<\/pre>\n\n\n\n<p>Note: we are updating the apt-file cache for future use:<\/p>\n\n\n\n<p>Therefore apt-file will go read the file \/etc\/apt\/sources.list and fill its cache (twenty megabytes for a basic Debian) to be ready for use. This is of course a command which we will reuse when we will update the file \/etc\/apt\/sources.list<\/p>\n\n\n\n<p>Now we can use apt-file and see what it is capable of!<\/p>\n\n\n\n<p><strong>Listing the files of a Debian package:<\/strong><\/p>\n\n\n\n<p>The first rather practical thing we do with apt-file list the files that are contained in a Debian package (.deb). For your information a Debian package is a set of files that contains config, script, information storage, etc\u2026 files placed in a package and ready to deploy.<\/p>\n\n\n\n<p>With Apt-file, we able to view the files that deployed during the installation with the apt-get installed before the actual installation. More simply, you can perform the following command to view the files contained in the Debian package fail2ban.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt-file show fail2ban<\/pre>\n\n\n\n<p>Note: Apt-file gives us the files contained in the package Fail2ban.<\/p>\n\n\n\n<p>This shows that different files placed in \/ etc \/ default, but also in the \/ etc \/ fail2ban \/, etc\u2026<\/p>\n\n\n\n<p><strong>Finding the package file<\/strong><\/p>\n\n\n\n<p>A second interesting enough action performed with apt-file. It can in fact find, from a file selected, the package Debian associated with it. If one wishes to know which package is installed on another server for precise control, one just goes on to that server with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt-file search \/usr\/bin\/htpasswd<\/pre>\n\n\n\n<p>Note: command \u201chtpasswd\u201d supplied with apache2). And the option \u201csearch\u201d in apt-file retrieves the packet associated with a file or command. This shows that the controller and tool \u201chtpasswd\u201d come with the packages apache2-dbg and apache2-utils.<\/p>\n\n\n\n<p>Note: a little tip, when looking for the packer corresponding to a command or file, it\u2019s advisable to put the absolute path to it, it can exclude some results and unnecessary rows in the result. The absolute path to a command found with the option \u201cwhereis\u201d. For example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">whereis htpasswd<\/pre>\n\n\n\n<p>Note: the \u201cwhereis\u201d command is to find the path of an executable.<\/p>\n\n\n\n<p><strong>Additional Options<\/strong><\/p>\n\n\n\n<p>When using apt-file, several options used to extend the tool&#8217;s capabilities. One can for specify a file source.list (containing a Debian repository list) other than the file \/etc\/sources.list. This may allow a comparison between packets quickly supplied from different repositories or between two files. Sources.list option going to do using \u201c-s\u201d or \u201c\u2013sources.list\u201d.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt-file show apache2 --sources-list \/opt\/sources.list.test<\/pre>\n\n\n\n<p>One can also specify a precise architecture with the &#8220;-a&#8221; or &#8220;-architecture&#8221;:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt-search \/usr\/bin\/owncloud -a amd64<\/pre>\n\n\n\n<p>Apt-file can be very useful in some contexts and it is a tool that is good to know!<\/p>\n\n\n\n<p><strong>Incoming searches related to this post<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>debian apt-get<\/li>\n\n\n\n<li>debian apt sources<\/li>\n\n\n\n<li>debian testing apt<\/li>\n\n\n\n<li>debian apt mirrors<\/li>\n\n\n\n<li>debian apt search<\/li>\n\n\n\n<li>debian apt list installed packages<\/li>\n\n\n\n<li>debian apt repository<\/li>\n\n\n\n<li>debian apt pinning<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Apt-file to explore the Debian packages: when one uses only the command line on Linux, there are tools to have in your pocket, so apt-file for exploring the Debian packages&hellip;<\/p>\n<p><a href=\"https:\/\/www.bodhost.com\/kb\/apt-file-to-explore-the-debian-packages\/\" class=\"more-link\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[297],"tags":[616,618,617,79],"class_list":["post-4639","post","type-post","status-publish","format-standard","hentry","category-faq","tag-debian","tag-debian-apt-file","tag-debian-apt-get","tag-debian-dedicated-servers"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Explore the Debian Packages with Apt-file<\/title>\n<meta name=\"description\" content=\"Apt-file to explore the Debian packages: when one uses only the command line on Linux, there are tools to have in your pocket\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.bodhost.com\/kb\/apt-file-to-explore-the-debian-packages\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Explore the Debian Packages with Apt-file\" \/>\n<meta property=\"og:description\" content=\"Apt-file to explore the Debian packages: when one uses only the command line on Linux, there are tools to have in your pocket\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.bodhost.com\/kb\/apt-file-to-explore-the-debian-packages\/\" \/>\n<meta property=\"og:site_name\" content=\"Knowledge Base - bodHOST\" \/>\n<meta property=\"article:published_time\" content=\"2014-11-28T09:44:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-26T14:04:31+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/apt-file-to-explore-the-debian-packages\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/apt-file-to-explore-the-debian-packages\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/c48414ad1536cea20e85282b0737a9f9\"},\"headline\":\"Explore the Debian Packages with Apt-file\",\"datePublished\":\"2014-11-28T09:44:56+00:00\",\"dateModified\":\"2026-02-26T14:04:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/apt-file-to-explore-the-debian-packages\\\/\"},\"wordCount\":566,\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"keywords\":[\"debian\",\"debian apt-file\",\"debian apt-get\",\"Debian Dedicated Servers\"],\"articleSection\":[\"FAQs\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/apt-file-to-explore-the-debian-packages\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/apt-file-to-explore-the-debian-packages\\\/\",\"name\":\"Explore the Debian Packages with Apt-file\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\"},\"datePublished\":\"2014-11-28T09:44:56+00:00\",\"dateModified\":\"2026-02-26T14:04:31+00:00\",\"description\":\"Apt-file to explore the Debian packages: when one uses only the command line on Linux, there are tools to have in your pocket\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/apt-file-to-explore-the-debian-packages\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/apt-file-to-explore-the-debian-packages\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/apt-file-to-explore-the-debian-packages\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"FAQs\",\"item\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/category\\\/faq\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Explore the Debian Packages with Apt-file\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"alternateName\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"contentUrl\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"width\":240,\"height\":240,\"caption\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/c48414ad1536cea20e85282b0737a9f9\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Explore the Debian Packages with Apt-file","description":"Apt-file to explore the Debian packages: when one uses only the command line on Linux, there are tools to have in your pocket","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.bodhost.com\/kb\/apt-file-to-explore-the-debian-packages\/","og_locale":"en_US","og_type":"article","og_title":"Explore the Debian Packages with Apt-file","og_description":"Apt-file to explore the Debian packages: when one uses only the command line on Linux, there are tools to have in your pocket","og_url":"https:\/\/www.bodhost.com\/kb\/apt-file-to-explore-the-debian-packages\/","og_site_name":"Knowledge Base - bodHOST","article_published_time":"2014-11-28T09:44:56+00:00","article_modified_time":"2026-02-26T14:04:31+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.bodhost.com\/kb\/apt-file-to-explore-the-debian-packages\/#article","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/apt-file-to-explore-the-debian-packages\/"},"author":{"name":"admin","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/c48414ad1536cea20e85282b0737a9f9"},"headline":"Explore the Debian Packages with Apt-file","datePublished":"2014-11-28T09:44:56+00:00","dateModified":"2026-02-26T14:04:31+00:00","mainEntityOfPage":{"@id":"https:\/\/www.bodhost.com\/kb\/apt-file-to-explore-the-debian-packages\/"},"wordCount":566,"publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"keywords":["debian","debian apt-file","debian apt-get","Debian Dedicated Servers"],"articleSection":["FAQs"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.bodhost.com\/kb\/apt-file-to-explore-the-debian-packages\/","url":"https:\/\/www.bodhost.com\/kb\/apt-file-to-explore-the-debian-packages\/","name":"Explore the Debian Packages with Apt-file","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/#website"},"datePublished":"2014-11-28T09:44:56+00:00","dateModified":"2026-02-26T14:04:31+00:00","description":"Apt-file to explore the Debian packages: when one uses only the command line on Linux, there are tools to have in your pocket","breadcrumb":{"@id":"https:\/\/www.bodhost.com\/kb\/apt-file-to-explore-the-debian-packages\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.bodhost.com\/kb\/apt-file-to-explore-the-debian-packages\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.bodhost.com\/kb\/apt-file-to-explore-the-debian-packages\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"FAQs","item":"https:\/\/www.bodhost.com\/kb\/category\/faq\/"},{"@type":"ListItem","position":2,"name":"Explore the Debian Packages with Apt-file"}]},{"@type":"WebSite","@id":"https:\/\/www.bodhost.com\/kb\/#website","url":"https:\/\/www.bodhost.com\/kb\/","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","description":"","publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"alternateName":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.bodhost.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.bodhost.com\/kb\/#organization","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","url":"https:\/\/www.bodhost.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","contentUrl":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","width":240,"height":240,"caption":"Web Hosting Knowledge Base | bodHOST Hosting FAQ"},"image":{"@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/c48414ad1536cea20e85282b0737a9f9","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g","caption":"admin"},"url":"https:\/\/www.bodhost.com\/kb\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/4639","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/comments?post=4639"}],"version-history":[{"count":7,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/4639\/revisions"}],"predecessor-version":[{"id":12179,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/4639\/revisions\/12179"}],"wp:attachment":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/media?parent=4639"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/categories?post=4639"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/tags?post=4639"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}