<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Karuppiah</title>
    <description>The latest articles on DEV Community by Karuppiah (@karuppiah7890).</description>
    <link>https://dev.to/karuppiah7890</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F86287%2F1bf26ae2-9206-4cf8-9424-d6c1a26949cc.jpg</url>
      <title>DEV Community: Karuppiah</title>
      <link>https://dev.to/karuppiah7890</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/karuppiah7890"/>
    <language>en</language>
    <item>
      <title>Debian Packages</title>
      <dc:creator>Karuppiah</dc:creator>
      <pubDate>Tue, 23 Jun 2026 12:10:18 +0000</pubDate>
      <link>https://dev.to/karuppiah7890/debian-packages-51gj</link>
      <guid>https://dev.to/karuppiah7890/debian-packages-51gj</guid>
      <description>&lt;p&gt;Ubuntu OS (Operating System) is a distribution of Linux OS and is a derivative of Debian OS which is another distribution of Linux OS&lt;/p&gt;

&lt;p&gt;A lot of people use Ubuntu for their Linux Servers and even as their Desktop machine OS. I personally use Ubuntu a lot when working with Linux VMs, for playing around with things. It's free, and it has the most basic things. It's also the one distribution that I have used a lot of. While many hard core linux nerds might talk about other light weight and fast Linux distributions and fancy ones too, like Arch Linux etc, I personally like Ubuntu&lt;/p&gt;

&lt;p&gt;In Ubuntu, a popular way to install software is by using &lt;code&gt;apt&lt;/code&gt; (previously &lt;code&gt;apt-get&lt;/code&gt;). &lt;code&gt;apt&lt;/code&gt; is a package manager for Debian and it's derivatives like Ubuntu. &lt;code&gt;apt&lt;/code&gt; is short for Advanced Package Tool (APT)&lt;/p&gt;

&lt;p&gt;&lt;code&gt;apt&lt;/code&gt; has CLI (Command Line Interface) interface - basically it's a command line tool, not some fancy GUI (Graphical User Interface) program with windows, buttons etc&lt;/p&gt;

&lt;p&gt;When you do &lt;code&gt;apt install -y python3&lt;/code&gt;, it installs Python v3.x.y for you&lt;/p&gt;

&lt;p&gt;When you do &lt;code&gt;apt update&lt;/code&gt; it updates the local repository index from the repository sources that are configured in the system. Usually these are present in &lt;code&gt;/etc/apt/sources.list&lt;/code&gt; file and also inside a directory &lt;code&gt;/etc/apt/sources.list.d/&lt;/code&gt;. For example, I'm using a Linux VM which has Ubuntu 26.04 LTS. I can see that there's a source list file in &lt;code&gt;/etc/apt/sources.list.d/&lt;/code&gt; - &lt;code&gt;/etc/apt/sources.list.d/ubuntu.sources&lt;/code&gt;, which reads like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /etc/apt/sources.list.d/ubuntu.sources 
&lt;span class="c"&gt;# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to&lt;/span&gt;
&lt;span class="c"&gt;# newer versions of the distribution.&lt;/span&gt;

&lt;span class="c"&gt;## Ubuntu distribution repository&lt;/span&gt;
&lt;span class="c"&gt;##&lt;/span&gt;
&lt;span class="c"&gt;## The following settings can be adjusted to configure which packages to use from Ubuntu.&lt;/span&gt;
&lt;span class="c"&gt;## Mirror your choices (except for URIs and Suites) in the security section below to&lt;/span&gt;
&lt;span class="c"&gt;## ensure timely security updates.&lt;/span&gt;
&lt;span class="c"&gt;##&lt;/span&gt;
&lt;span class="c"&gt;## Types: Append deb-src to enable the fetching of source package.&lt;/span&gt;
&lt;span class="c"&gt;## URIs: A URL to the repository (you may add multiple URLs)&lt;/span&gt;
&lt;span class="c"&gt;## Suites: The following additional suites can be configured&lt;/span&gt;
&lt;span class="c"&gt;##   &amp;lt;name&amp;gt;-updates   - Major bug fix updates produced after the final release of the&lt;/span&gt;
&lt;span class="c"&gt;##                      distribution.&lt;/span&gt;
&lt;span class="c"&gt;##   &amp;lt;name&amp;gt;-backports - software from this repository may not have been tested as&lt;/span&gt;
&lt;span class="c"&gt;##                      extensively as that contained in the main release, although it includes&lt;/span&gt;
&lt;span class="c"&gt;##                      newer versions of some applications which may provide useful features.&lt;/span&gt;
&lt;span class="c"&gt;##                      Also, please note that software in backports WILL NOT receive any review&lt;/span&gt;
&lt;span class="c"&gt;##                      or updates from the Ubuntu security team.&lt;/span&gt;
&lt;span class="c"&gt;## Components: Aside from main, the following components can be added to the list&lt;/span&gt;
&lt;span class="c"&gt;##   restricted  - Software that may not be under a free license, or protected by patents.&lt;/span&gt;
&lt;span class="c"&gt;##   universe    - Community maintained packages. Software in this repository receives maintenance&lt;/span&gt;
&lt;span class="c"&gt;##                 from volunteers in the Ubuntu community, or a 10 year security maintenance&lt;/span&gt;
&lt;span class="c"&gt;##                 commitment from Canonical when an Ubuntu Pro subscription is attached.&lt;/span&gt;
&lt;span class="c"&gt;##   multiverse  - Community maintained of restricted. Software from this repository is&lt;/span&gt;
&lt;span class="c"&gt;##                 ENTIRELY UNSUPPORTED by the Ubuntu team, and may not be under a free&lt;/span&gt;
&lt;span class="c"&gt;##                 licence. Please satisfy yourself as to your rights to use the software.&lt;/span&gt;
&lt;span class="c"&gt;##                 Also, please note that software in multiverse WILL NOT receive any&lt;/span&gt;
&lt;span class="c"&gt;##                 review or updates from the Ubuntu security team.&lt;/span&gt;
&lt;span class="c"&gt;##&lt;/span&gt;
&lt;span class="c"&gt;## See the sources.list(5) manual page for further settings.&lt;/span&gt;
Types: deb
URIs: http://archive.ubuntu.com/ubuntu/
Suites: resolute resolute-updates resolute-backports
Components: main universe restricted multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

&lt;span class="c"&gt;## Ubuntu security updates. Aside from URIs and Suites,&lt;/span&gt;
&lt;span class="c"&gt;## this should mirror your choices in the previous section.&lt;/span&gt;
Types: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: resolute-security
Components: main universe restricted multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, how does &lt;code&gt;apt install python3&lt;/code&gt; really work? It works by looking at the packages available in the local repository index - which is obtained from official sources and any other extra third party sources - that the user trusted and added to the list of sources. For example, I have added ClickHouse package repository as a source, like this -&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /etc/apt/sources.list.d/clickhouse.list 
deb &lt;span class="o"&gt;[&lt;/span&gt;signed-by&lt;span class="o"&gt;=&lt;/span&gt;/usr/share/keyrings/clickhouse-keyring.gpg] https://packages.clickhouse.com/deb lts main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the above to work, I did the following in order&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Get necessary packages&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; apt-transport-https ca-certificates curl gnupg

&lt;span class="c"&gt;# Get ClickHouse Keyring - for the channel you want. For example, the below is for LTS channel, there's another channel named as Stable channel&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; &lt;span class="s1"&gt;'https://packages.clickhouse.com/rpm/lts/repodata/repomd.xml.key'&lt;/span&gt; | &lt;span class="nb"&gt;sudo &lt;/span&gt;gpg &lt;span class="nt"&gt;--dearmor&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; /usr/share/keyrings/clickhouse-keyring.gpg

&lt;span class="c"&gt;# Finally create a sources list file with the keyring and the ClickHouse package repository URL&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"deb [signed-by=/usr/share/keyrings/clickhouse-keyring.gpg] https://packages.clickhouse.com/deb lts main"&lt;/span&gt; | &lt;span class="nb"&gt;sudo tee&lt;/span&gt; /etc/apt/sources.list.d/clickhouse.list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, after checking the local repository index, it gets the package information from there. You can find this information yourself too and do the search yourself too. For example, like this -&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;apt search python3

&lt;span class="nv"&gt;$ &lt;/span&gt;apt info python3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once it has the information from the local repository index about the package, it uses that information to download the package and install it. When I say package - it's the software - packaged software, which can be installed with any extra things that's provided with the package - say install scripts etc&lt;/p&gt;

&lt;p&gt;In the case of Debian Linux Distributions like Ubuntu, the packages are called Debian Packages&lt;/p&gt;

&lt;p&gt;Now, how do you see what's a Debian Package you ask? Well, you can just download the package file and see it yourself&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;apt download python3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will see something like &lt;code&gt;python3_3.14.3-0ubuntu2_amd64.deb&lt;/code&gt; downloaded in your local machine in the directory that you ran the above command in. Once it's downloaded, you can inspect this file in various ways. One way is to use &lt;code&gt;dpkg&lt;/code&gt; and related tools like &lt;code&gt;dpkg-deb&lt;/code&gt; etc. Another way is to use &lt;code&gt;ar&lt;/code&gt; tool. The Debian package that you have downloaded is file with &lt;code&gt;.deb&lt;/code&gt; extension - to indicate that it's a Debian package file. &lt;code&gt;.deb&lt;/code&gt; Debian package files are basically &lt;code&gt;ar&lt;/code&gt; archives. &lt;code&gt;ar&lt;/code&gt; is an archive utility similar to &lt;code&gt;tar&lt;/code&gt;, &lt;code&gt;zip&lt;/code&gt;, &lt;code&gt;gzip&lt;/code&gt; etc&lt;/p&gt;

&lt;p&gt;To see the contents of the &lt;code&gt;.deb&lt;/code&gt; archive file which is an &lt;code&gt;ar&lt;/code&gt; archive file, do something like this -&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;ar tv python3_3.14.3-0ubuntu2_amd64.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Note: Before using &lt;code&gt;ar&lt;/code&gt;, you will need &lt;code&gt;ar&lt;/code&gt;. You will need to install &lt;code&gt;ar&lt;/code&gt; using something like &lt;code&gt;sudo apt install binutils&lt;/code&gt;. &lt;code&gt;binutils&lt;/code&gt; package has &lt;code&gt;ar&lt;/code&gt; as part of it&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Output will look like this -&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;ar tv python3_3.14.3-0ubuntu2_amd64.deb
rw-r--r-- 0/0      4 Mar 21 09:46 2026 debian-binary
rw-r--r-- 0/0   1770 Mar 21 09:46 2026 control.tar.zst
rw-r--r-- 0/0  20976 Mar 21 09:46 2026 data.tar.zst
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can see that &lt;code&gt;.deb&lt;/code&gt; files are not magic and that they are just compressed (or archived) files, using &lt;code&gt;ar&lt;/code&gt; tool&lt;/p&gt;

&lt;p&gt;You can also extract the &lt;code&gt;.deb&lt;/code&gt; files using &lt;code&gt;ar&lt;/code&gt;, like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ar xv python3_3.14.3-0ubuntu2_amd64.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output will look like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;ar xv python3_3.14.3-0ubuntu2_amd64.deb
x - debian-binary
x - control.tar.zst
x - data.tar.zst
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, you can check these files&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: Before using &lt;code&gt;zstd&lt;/code&gt; as part of &lt;code&gt;tar&lt;/code&gt;, you will need &lt;code&gt;zstd&lt;/code&gt;. You will need to install &lt;code&gt;zstd&lt;/code&gt; using something like &lt;code&gt;sudo apt install zstd&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can use &lt;code&gt;tar&lt;/code&gt; and internally &lt;code&gt;zstd&lt;/code&gt; to see the contents of these &lt;code&gt;.zst&lt;/code&gt; files&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;tar &lt;/span&gt;tf control.tar.zst
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output will look like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;tar &lt;/span&gt;tf control.tar.zst
./
./control
./md5sums
./postinst
./postrm
./preinst
./prerm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;tar &lt;/span&gt;tf data.tar.zst
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output will look something like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;tar &lt;/span&gt;tf data.tar.zst
./
./usr/
./usr/bin/
./usr/lib/
./usr/lib/valgrind/
./usr/lib/valgrind/python3.supp
./usr/share/
./usr/share/doc/
./usr/share/doc/python3/
./usr/share/doc/python3/copyright
./usr/share/doc/python3/python-policy.txt.gz
./usr/share/doc/python3.14/
./usr/share/doc-base/
./usr/share/doc-base/python3.python-policy
./usr/share/lintian/
./usr/share/lintian/overrides/
./usr/share/lintian/overrides/python3
./usr/share/man/
./usr/share/man/man1/
./usr/share/pixmaps/
./usr/share/python3/
./usr/share/python3/python.mk
./usr/share/python3/runtime.d/
./usr/share/python3/runtime.d/public_modules.rtinstall
./usr/share/python3/runtime.d/public_modules.rtremove
./usr/bin/pdb3
./usr/bin/pydoc3
./usr/bin/pygettext3
./usr/share/doc/python3/README.Debian
./usr/share/doc/python3/changelog.Debian.gz
./usr/share/doc/python3.14/python-policy.txt.gz
./usr/share/man/man1/pdb3.1.gz
./usr/share/man/man1/pydoc3.1.gz
./usr/share/man/man1/pygettext3.1.gz
./usr/share/pixmaps/python3.xpm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Note: You can also use &lt;code&gt;tar tvf data.tar.zst&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To extract the files, just use this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;tar &lt;/span&gt;xvf data.tar.zst
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will notice that the &lt;code&gt;debian-binary&lt;/code&gt; is just a plain text file -&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;file debian-binary

&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cat &lt;/span&gt;debian-binary
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output will look something like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;file debian-binary
debian-binary: ASCII text

&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cat &lt;/span&gt;debian-binary
2.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;data.tar.zst&lt;/code&gt; is the set of files that will get "installed" - that is, get put into the right places, like &lt;code&gt;/usr&lt;/code&gt;, &lt;code&gt;/usr/bin/&lt;/code&gt;, &lt;code&gt;/usr/share/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;control.tar.zst&lt;/code&gt; is the set of files which contains package metadata, post install script (postinst), pre install script (preinst), etc.&lt;/p&gt;

&lt;p&gt;I ended up learning all this when I was checking how to find the different configurations that I can provide during installation of ClickHouse Server package (&lt;code&gt;clickhouse-server&lt;/code&gt;), since I wanted to install it in a machine automatically with no human intervention but when I ran &lt;code&gt;apt install -y clickhouse-server&lt;/code&gt;, it installed ClickHouse Server but also started setting it up and asked default user's password for the default ClickHouse DB user - and this was an interactive input. So, on digging I found that it's part of post install script and it can be bypassed by using an environment variable. An AI told this to me (ChatGPT!). But then, I wanted to know what all such environment variables are there that I can set and use to control the installation, and that's when I learned all this Debian Package stuff :)&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>cli</category>
      <category>linux</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
