Install Raku
Linux
Other download and installation options are available.
Rakubrew is a Raku installation tool. It allows you to have multiple versions of different Raku implementations installed in parallel and switch between them. It's a perlbrew and plenv look alike and supports both flavours of commands.
Installation
Just copy and paste the following piece of code into a console.
curl https://rakubrew.org/install-on-perl.sh | shBare Bones Installation
If the above installation script somehow doesn't work for you, you can install Rakubrew manually.
First download the Rakubrew executable:
https://rakubrew.org/perl/rakubrewThen give that file executable permissions:
chmod +x rakubrewAdd the Rakubrew and shim folders to your PATH:
# Bash & ZSH
export PATH=/path/where/rakubrew/is:$PATH
export PATH=$(rakubrew home)/shims:$PATH# Fish
fish_add_path -g /path/where/rakubrew/is
fish_add_path -g (rakubrew home)/shimsFinally run
rakubrew mode shimThat's all!
Shell Hook
If you want to use env mode, the shell command or have auto-completion, you need to install the shell hook. To get the instructions on how to do that type
rakubrew initInstallation Path
To make Rakubrew use a different directory to store its files set the RAKUBREW_HOME environment variable prior to calling it. Put the following into your .bashrc or similar:
export RAKUBREW =~/rakubrew # or some other pathHow
# list available versions
rakubrew available# download and install the latest Rakudo on MoarVM version
rakubrew download# switch to use that version (substitute the version you just installed)
rakubrew switch moar-2025.05raku -e 'say "Now running {$*RAKU.compiler.version}!"'Global, Shell, Local
Rakubrew knows three different versions that can be set separately.
The global version is the one that is selected when neither the shell version nor the local version are active.
The shell version changes the active raku version just in the current shell. Closing the current shell also looses the shell version.
The local version is specific to a folder. When CWD is in that folder or a sub folder that version of raku is used. Only works in shim mode. To unset a local version one must delete the .RAKU_VERSION file in the respective folder.
Modes
Rakubrew can work in two distinct modes: env and shim
In env mode Rakubrew modifies the $PATH variable as needed when switching between versions. This is neat because one then runs the executables directly. This is the default mode on *nix.
In shim mode Rakubrew generates wrapper scripts called shims for all executables it can find in all the different raku installations. These shims forward to the actual executable when called. This mechanism allows for some advanced features, such as local versions. When installing a module that adds scripts one must make Rakubrew aware of these new scripts. This is done with
rakubrew rehashIn env mode this is not necessary.
Registering External Versions
To add a raku installation to Rakubrew that was created outside of Rakubrew one should do:
rakubrew register name-of-version /path/to/raku/install/directoryUpgrading
rakubrew self-upgradeUninstall
To remove Rakubrew and any raku implementations it has installed on your system, delete the ~/.rakubrew and ~/.local/share/rakubrew directories.
Further Info
More information on Rakubrew is available here