{"id":4915,"date":"2025-11-07T18:40:26","date_gmt":"2025-11-07T17:40:26","guid":{"rendered":"https:\/\/infosec.andreas-klingler.de\/?p=4915"},"modified":"2025-11-07T19:17:12","modified_gmt":"2025-11-07T18:17:12","slug":"debian-package-managment-system","status":"publish","type":"post","link":"https:\/\/infosec.andreas-klingler.de\/?p=4915","title":{"rendered":"Debian Package Managment System"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Show info:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">dpkg --info $package<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Show all files of a&nbsp;deb:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">dpkg -L $package<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Show all installed packages:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">dpkg -l<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Search for a file or&nbsp;path:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">dpkg -S htpasswd<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Show why a pack\u00adage was installed:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apitude why apache2-utils<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">About deb&nbsp;files<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A deb file is a ar archive with this structure:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ ar t example.deb<br>debian-binary<br>control.tar.xz (or .gz or .zst)<br>data.tar.xz    (or .gz or .zst)<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em>debian-bina\u00adry <\/em>is a text file with the ver\u00adsion, cur\u00adrent\u00adly \u201c2.0\u201d<\/li>\n\n\n\n<li><em>control.tar.xz<\/em> con\u00adtains meta\u00adda\u00adta and scripts.<\/li>\n\n\n\n<li><em>data.tar.xz<\/em> con\u00adtains the files to be installed\/copied.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">There are these pack\u00adage formats:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Real pack\u00adage<\/strong><\/li>\n\n\n\n<li><strong>Meta\u00adpack\u00adage<\/strong> is a pack\u00adage with\u00adout own con\u00adtent which only ref\u00ader\u00adences oth\u00ader packages.<\/li>\n\n\n\n<li><strong>Vir\u00adtu\u00adal pack\u00adage<\/strong> is just an addi\u00adtion\u00adal name for anoth\u00ader pack\u00adage (basi\u00adcal\u00adly a&nbsp;link)<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Using other architectures<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">dpkg --print-architecture<br>dpkg --add-architecture i386<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Getting \/ Rebuilding (debian-based) packages<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Get source of a package:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt source $name<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To get all need\u00aded build tools, into the source code direc\u00adto\u00adry from the package:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt build-dep .\/<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Change the ver\u00adsion number<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">dch --local version-identifier<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Per\u00adform the changes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then, build the package.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">dpkg-buildpackage -us -uc -b<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">And install it.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">dpkg -i $name.deb<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Show info: dpkg \u2013info $pack\u00adage Show all files of a&nbsp;deb: dpkg \u2011L $pack\u00adage Show all installed pack\u00adages: dpkg \u2011l Search for a file or&nbsp;path: dpkg \u2011S htpass\u00adwd Show why a pack\u00adage was installed: api\u00adtude why apache2-utils About deb&nbsp;files A deb file is a ar archive with this struc\u00adture: $ ar t example.debdebian-binarycontrol.tar.xz (or .gz&nbsp;or&nbsp;[\u2026]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"wp_typography_post_enhancements_disabled":false,"footnotes":""},"categories":[468],"tags":[173,530,528,529],"class_list":["post-4915","post","type-post","status-publish","format-standard","hentry","category-general","tag-apt","tag-deb","tag-debian","tag-dpkg"],"_links":{"self":[{"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/posts\/4915","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4915"}],"version-history":[{"count":5,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/posts\/4915\/revisions"}],"predecessor-version":[{"id":4924,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=\/wp\/v2\/posts\/4915\/revisions\/4924"}],"wp:attachment":[{"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/infosec.andreas-klingler.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}