blog,

Switching to use Ruby 2.7 (or older) in Fedora 34 using DNF Modules

Izhar Firdaus Izhar Firdaus Follow Support May 18, 2021 · 1 min read
Switching to use Ruby 2.7 (or older) in Fedora 34 using DNF Modules
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.

Fedora 34 now ships with Ruby 3.0 by default, which might be great news for Ruby developers. However, for those who might still be relying on older version of Ruby to run their stuff (eg: me), and don’t want to spend time updating things to make them work with Ruby 3.0 (like this Jekyll-based blog), the switch may be undesirable.

Good news, since Fedora 28, there is a lesser known feature of Fedora (and CentOS/RHEL), called DNF Modules, which came out of the Fedora Modularity initiative. DNF Modules allows you to configure your Fedora installation to track a specific version of upstream component (eg: Ruby27, PostgreSQL 10, etc) and would only receive updates and packages that are compatible with that version.

To switch to Ruby2.7, you can easily do it through following commands


$ sudo dnf module reset ruby
$ sudo dnf module install ruby:2.7
$ sudo dnf --allowerasing distro-sync

After the update, you will see that your default ruby installation is now using Ruby 2.7.

For more information on DNF Modules, check out Switching Module Streams documentation at Fedora Documentation site.

Written by Izhar Firdaus Follow Support
I'm a system architect, data engineer and developer advocate with passion in Free / Open Source software, entrepreneurship, community building, education and martial art. I take enjoyment in bridging and bringing together different FOSS technologies to help businesses and organizations utilize IT infrastructure to aid and optimize their business and organizational process.

The best practice method to install VirtualBox on Fedora 32/33 (and later)

In any linux distribution, there will be multiple methods to achieve a certain goal.You might have encountered many guides out there ...

In howto, Feb 22, 2021

« Previous Post