Sick Gaming
Fedora - Installing alternative versions of RPMs in Fedora - Printable Version

+- Sick Gaming (https://www.sickgaming.net)
+-- Forum: Computers (https://www.sickgaming.net/forum-86.html)
+--- Forum: Linux, FreeBSD, and Unix types (https://www.sickgaming.net/forum-88.html)
+--- Thread: Fedora - Installing alternative versions of RPMs in Fedora (/thread-90829.html)



Fedora - Installing alternative versions of RPMs in Fedora - xSicKxBot - 06-13-2019

Installing alternative versions of RPMs in Fedora

<div><p><a href="https://docs.pagure.org/modularity">Modularity</a> enables Fedora to provide alternative versions of RPM packages in the repositories. Several different applications, language runtimes, and tools are available in multiple versions, build natively for each Fedora release.&nbsp;</p>
<p> <span id="more-28346"></span> </p>
<p>The Fedora Magazine has already covered <a href="https://fedoramagazine.org/modularity-fedora-28-server-edition/">Modularity in Fedora 28 Server Edition</a> about a year ago. Back then, it was just an optional repository with additional content, and as the title hints, only available to the Server Edition. A lot has changed since then, and now <strong>Modularity is a core part of the Fedora distribution</strong>. And some packages have moved to modules completely. At the time of writing — out of the 49,464 binary RPM packages in Fedora 30 — 1,119 (2.26%) come from a module (<a href="https://blog.samalik.com/2019/06/12/counting-modularity-packages.html">more about the numbers</a>).</p>
<h2>Modularity basics</h2>
<p>Because having too many packages in multiple versions could feel overwhelming (and hard to manage), packages are grouped into <strong>modules</strong> that represent an application, a language runtime, or any other sensible group.</p>
<p>Modules often come in multiple <strong>streams</strong> — usually representing a major version of the software. Available in parallel, but only one stream of each module can be installed on a given system.</p>
<p>And not to overwhelm users with too many choices, each Fedora release comes with a set of <strong>defaults</strong> — so decisions only need to be made when desired.</p>
<p>Finally, to simplify installation, modules can be optionally installed using pre-defined <strong>profiles</strong> based on a use case. A database module, for example, could be installed as a client, a server, or both. </p>
<h2>Modularity in practice</h2>
<p>When you install an RPM package on your Fedora system, chances are it comes from a module stream. The reason why you might not have noticed is one of the core principles of Modularity — remaining invisible until there is a reason to know about it.</p>
<p>Let’s compare the following two situations. First, installing the popular <em>i3</em> tiling window manager, and second, installing the minimalist <em>dwm</em> window manager:</p>
<pre class="wp-block-preformatted">$ <strong>sudo dnf install i3</strong><br />...<br />Done!<br /></pre>
<p>As expected, the above command installs the <em>i3</em> package and its dependencies on the system. Nothing else happened here. But what about the other one?</p>
<pre class="wp-block-preformatted">$ <strong>sudo dnf install dwm</strong><br />...<br />Enabling module streams:<br /> dwm 6.1<br />...<br />Done!</pre>
<p>It feels the same, but something happened in the background — the default <em>dwm</em> module stream (<em>6.1</em>) got enabled, and the <em>dwm</em> package from the module got installed.</p>
<p>To be transparent, there is a message about the module auto-enablement in the output. But other than that, the user doesn’t need to know anything about Modularity in order to use their system the way they always did.</p>
<p>But what if they do? Let’s see how a different version of <em>dwm</em> could have been installed instead.</p>
<p>Use the following command to see what module streams are available:</p>
<pre class="wp-block-preformatted">$ <strong>sudo dnf module list</strong><br />...<br />dwm latest ...<br />dwm 6.0 ...<br />dwm 6.1 [d] ...<br />dwm 6.2 ...<br />...<br />Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled </pre>
<p>The output shows there are four streams of the <em>dwm</em> module, <em>6.1</em> being the default.</p>
<p>To install the <em>dwm</em> package in a different version — from the <em>6.2</em> stream for example — enable the stream and then install the package by using the two following commands:</p>
<pre class="wp-block-preformatted">$ <strong>sudo dnf module enable dwm:6.2</strong><br />...<br />Enabling module streams:<br /> dwm 6.2<br />...<br />Done!<br />$ <strong>sudo dnf install dwm</strong><br />...<br />Done!</pre>
<p>Finally, let’s have a look at profiles, with PostgreSQL as an example.</p>
<pre class="wp-block-preformatted">$ <strong>sudo dnf module list</strong><br />...<br />postgresql 9.6 client, server ...<br />postgresql 10 client, server ...<br />postgresql 11 client, server ...<br />...</pre>
<p>To install PostgreSQL 11 as a server, use the following command:</p>
<pre class="wp-block-preformatted">$ <strong>sudo dnf module install postgresql:11/server</strong></pre>
<p>Note that — apart from enabling — modules can be installed with a single command when a profile is specified.</p>
<p>It is possible to install multiple profiles at once. To add the client tools, use the following command:</p>
<pre class="wp-block-preformatted">$ <strong>sudo dnf module install postgresql:11/client</strong></pre>
<p>There are many other modules with multiple streams available to choose from. At the time of writing, there were 83 module streams in Fedora 30. That includes two versions of MariaDB, three versions of Node.js, two versions of Ruby, and many more.</p>
<p>Please refer to the <a href="https://docs.fedoraproject.org/en-US/modularity/using-modules/">official user documentation for Modularity</a> for a complete set of commands including switching from one stream to another.</p>
</div>