How To Install ruby-irb on CentOS 8

ruby-irb is The Interactive Ruby

Introduction

In this tutorial we learn how to install ruby-irb on CentOS 8.

What is ruby-irb

The irb is acronym for Interactive Ruby. It evaluates ruby expression from the terminal.

We can use yum or dnf to install ruby-irb on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install ruby-irb.

Install ruby-irb on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install ruby-irb using dnf by running the following command:

sudo dnf -y install ruby-irb

Install ruby-irb on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install ruby-irb using yum by running the following command:

sudo yum -y install ruby-irb

How To Uninstall ruby-irb on CentOS 8

To uninstall only the ruby-irb package we can use the following command:

sudo dnf remove ruby-irb

ruby-irb Package Contents on CentOS 8

/usr/bin/irb
/usr/share/man/man1/irb.1.gz
/usr/share/ruby/irb
/usr/share/ruby/irb.rb
/usr/share/ruby/irb/cmd
/usr/share/ruby/irb/cmd/chws.rb
/usr/share/ruby/irb/cmd/fork.rb
/usr/share/ruby/irb/cmd/help.rb
/usr/share/ruby/irb/cmd/load.rb
/usr/share/ruby/irb/cmd/nop.rb
/usr/share/ruby/irb/cmd/pushws.rb
/usr/share/ruby/irb/cmd/subirb.rb
/usr/share/ruby/irb/completion.rb
/usr/share/ruby/irb/context.rb
/usr/share/ruby/irb/ext
/usr/share/ruby/irb/ext/change-ws.rb
/usr/share/ruby/irb/ext/history.rb
/usr/share/ruby/irb/ext/loader.rb
/usr/share/ruby/irb/ext/multi-irb.rb
/usr/share/ruby/irb/ext/save-history.rb
/usr/share/ruby/irb/ext/tracer.rb
/usr/share/ruby/irb/ext/use-loader.rb
/usr/share/ruby/irb/ext/workspaces.rb
/usr/share/ruby/irb/extend-command.rb
/usr/share/ruby/irb/frame.rb
/usr/share/ruby/irb/help.rb
/usr/share/ruby/irb/init.rb
/usr/share/ruby/irb/input-method.rb
/usr/share/ruby/irb/inspector.rb
/usr/share/ruby/irb/lc
/usr/share/ruby/irb/lc/error.rb
/usr/share/ruby/irb/lc/help-message
/usr/share/ruby/irb/lc/ja
/usr/share/ruby/irb/lc/ja/encoding_aliases.rb
/usr/share/ruby/irb/lc/ja/error.rb
/usr/share/ruby/irb/lc/ja/help-message
/usr/share/ruby/irb/locale.rb
/usr/share/ruby/irb/magic-file.rb
/usr/share/ruby/irb/notifier.rb
/usr/share/ruby/irb/output-method.rb
/usr/share/ruby/irb/ruby-lex.rb
/usr/share/ruby/irb/ruby-token.rb
/usr/share/ruby/irb/slex.rb
/usr/share/ruby/irb/src_encoding.rb
/usr/share/ruby/irb/version.rb
/usr/share/ruby/irb/workspace.rb
/usr/share/ruby/irb/ws-for-case-2.rb
/usr/share/ruby/irb/xmp.rb

References

Summary

In this tutorial we learn how to install ruby-irb on CentOS 8 using yum and dnf.