<?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: luffy senpai</title>
    <description>The latest articles on DEV Community by luffy senpai (@luffyxxsenpai).</description>
    <link>https://dev.to/luffyxxsenpai</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2152058%2F1cface65-88c5-4941-9dfc-b3add4bb3fd5.jpg</url>
      <title>DEV Community: luffy senpai</title>
      <link>https://dev.to/luffyxxsenpai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/luffyxxsenpai"/>
    <language>en</language>
    <item>
      <title>package manager in linux</title>
      <dc:creator>luffy senpai</dc:creator>
      <pubDate>Tue, 01 Oct 2024 12:23:51 +0000</pubDate>
      <link>https://dev.to/luffyxxsenpai/package-manager-in-linux-1e5</link>
      <guid>https://dev.to/luffyxxsenpai/package-manager-in-linux-1e5</guid>
      <description>&lt;h3&gt;
  
  
  What is a package manager
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flq1qqkdclt3ohehhfqqf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flq1qqkdclt3ohehhfqqf.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A package manager in Linux is a tool or collection of tools that automates the process of installing, updating, configuring, and removing software packages. It ensures that software packages are installed correctly and that any necessary dependencies (other software required for the package to work) are also handled, making it easier for users to manage their system's software.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In Linux, most applications are distributed as &lt;strong&gt;packages&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A package is a bundle that contains software and the necessary files and metadata required for the software to function.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Packages simplify the process of installing, updating, and removing software along with handling dependencies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Linux distributions use their own package formats, like &lt;code&gt;.deb&lt;/code&gt; for Debian-based systems and &lt;code&gt;.rpm&lt;/code&gt; for RHEL-based systems.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Repositories&lt;/strong&gt; are centralized locations where packages are stored.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Most distributions have their own repositories, though third-party repositories also exist.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Components of a Package
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Binary or Source Code&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- **Binaries**: Pre-compiled, machine-readable code that can be executed directly by the OS.
- **Source code**: Human-readable code that gets compiled on the client system.
- Most distros like Ubuntu, Arch, and RHEL use binary-based package managers, while distros like Gentoo and Funtoo use source code-based package managers.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Metadata&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Metadata describes the package's name, version, architecture, description, dependencies, and maintainer information.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Dependencies&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Many packages require other packages to function properly. These additional packages are called **dependencies**. Dependencies are listed in the metadata, allowing the package manager to automatically handle them.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Scripts&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Packages often contain scripts to manage installation, configuration, or removal.
    - `preinst` and `postinst` scripts are run before and after installation.
    - `prerm` and `postrm` scripts are run before and after removal.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Type of package manager
&lt;/h3&gt;
&lt;h6&gt;
  
  
  Low-level package manager
&lt;/h6&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- dpkg and rpm are responsible for directly installing, removing, and managing package manually.
- however, they don't resolve dependencies automatically.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h6&gt;
  
  
  High-level package manager
&lt;/h6&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- APT [[apt]]  and YUM/DNF [[yum-dnf]] are like wrappers over dpkg and rpm
- they provide aditional features like dependency resolution, package updates, repository management.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;try this &lt;a href="https://www.internalpointers.com/post/build-binary-deb-package-practical-guide" rel="noopener noreferrer"&gt;make your own deb package&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>linux</category>
      <category>ubuntu</category>
      <category>apt</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
