Polyglot has asked for the wisdom of the Perl Monks concerning the following question:

Somehow, my server's ubuntu version fell between the cracks with having a proper Raku distribution [EDIT: "zef" was deleted from the distro, as seen HERE]. I have followed various online guides for installing Raku's package manager, zef, to no avail. It goes without saying that to use Raku, installing Raku modules is important. Here's what I've tried:
#AS PER https://github.com/ugexe/zef $ git clone https://github.com/ugexe/zef.git $ cd zef $ raku -I. bin/zef install .
Having done the above from within my /usr/src directory, this resulted in a download and supposed install of the zef application. However, attempting to run "zef" at the command line resulted in....
Command 'zef' not found, did you mean: command 'zec' from deb zec (0.12-5) command 'zed' from deb zfs-zed (2.1.5-1ubuntu6~22.04.1) Try: apt install <deb name>
Not to be so easily deterred, I navigated to zef's /bin directory where the zef binary file was, and ran ./zef --help from there. This yielded the following results:
===SORRY!=== Error while compiling /usr/lib/perl6/zef/bin/./zef Could not find Zef::CLI in: inst#/root/.raku inst#/usr/lib/perl6/site inst#/usr/lib/perl6/vendor inst#/usr/lib/perl6/core ap# nqp# perl5# at /usr/lib/perl6/zef/bin/./zef:3
Noticing that the /usr/lib/perl6 directory seemed to be in the expected path, I moved the entire zef directory there, only to arrive at the same results.

An internet search then yielded another hope, which I tried--a page which claims to have been updated this very day.

#AS PER https://linux-packages.com/ubuntu-jammy-jellyfish/package/perl +6-zef perl6-zef on Ubuntu 22.04 LTS (Jammy Jellyfish) Last updated: December 28,2023 1. Install perl6-zef package Please follow the step by step instructions below to install perl6-zef + package: sudo apt update sudo apt install perl6-zef
Having completed the above steps, the results of the latter one were as follows:
Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package perl6-zef
...and I am essentially right back to where I began, with no 'zef' at all. An apt-cache search perl6 shows no zef option. It has only the following:
dh-perl6 - debhelper add-on to simplify Perl 6 package building libexport-attrs-perl - Perl 6 'is export(...)' trait as a Perl 5 attri +bute libmethod-signatures-perl - method and function declarations with sign +atures and no source filter libparse-method-signatures-perl - Perl module to parse Perl6-like meth +od signatures libperl6-caller-perl - Perl6-like OO caller() interface for Perl 5 libperl6-export-attrs-perl - Perl 6 'is export(...)' trait as a Perl 5 + attribute libperl6-export-perl - implementation of the Perl 6 'is export(...)' t +rait libperl6-form-perl - Perl 5 implementation of the Perl 6 'form' built- +in libperl6-junction-perl - module providing Perl6-style Junction operato +rs in Perl5 libperl6-say-perl - module to print without newline needed libperl6-slurp-perl - module implementing the Perl 6 'slurp' built-in libsyntax-keyword-junction-perl - Perl6 style Junction operators in Pe +rl5 nqp - Not Quite Perl compiler nqp-data - Data files for NQP compiler perl6-readline - Readline binding for Perl 6 raku-getopt-long - Getopt implementation for Raku rakudo - Perl 6 implementation on top of Moar virtual machine
Searching apt for 'zef' strangely nets this:
picard-tools - Command line tools to manipulate SAM and BAM files

Advice for correct installation of Raku's package manager on the latest Ubuntu LTS would be greatly appreciated.

Blessings,

~Polyglot~

Replies are listed 'Best First'.
Re: [RAKU] How to install zef on Ubuntu 22.04
by Corion (Patriarch) on Dec 28, 2023 at 08:06 UTC
    ... $ raku -I. bin/zef install .

    So, what was the output of the above command? Where does raku claim it installed the zef binary?

    Does that file actually exist?

    Can you invoke it with a full path, like /usr/bin/whatever/zef?

    Personally I would never clone a git directory into /usr/src and always build as the local user, not root, but maybe Ubuntu is different - I use Debian...

      The output of that command was this:
      ===> Staging zef:ver<0.21.2>:auth<github:ugexe>:api<0> ===> Staging [OK] for zef:ver<0.21.2>:auth<github:ugexe>:api<0> No such method 'remove-artifacts' for invocant of type 'CompUnit::Repository::Staging'
      Raku makes no claims, so far as I can see, to even having installed zef, much less telling me the path to it. When I navigate to /usr/src/zef/bin and run zef directly, I still get this:
      /usr/src/zef/bin# zef Command 'zef' not found, did you mean: command 'zed' from deb zfs-zed (2.1.5-1ubuntu6~22.04.1) command 'zec' from deb zec (0.12-5) Try: apt install <deb name>
      In order to actually execute it, I must invoke it as a script, or run it with Raku, like this:
      /usr/src/zef/bin# raku zef ===SORRY!=== Error while compiling /usr/src/zef/bin/zef Could not find Zef::CLI in: inst#/root/.raku inst#/usr/lib/perl6/site inst#/usr/lib/perl6/vendor inst#/usr/lib/perl6/core ap# nqp# perl5# at /usr/src/zef/bin/zef:3
      ...and you can see the result there. This is the same result as if trying to run it via the full path, i.e. /usr/src/zef/bin/zef.

      Note that no man pages exist for zef, and a which zef command returns empty.

      Blessings,

      ~Polyglot~

        Yes, I think you should debug why the installation instructions fail.

        As for the "zef binary not found" part, you seem to be running as root and traditionally, the current directory (., dot) is not in the search path. You want to try to execute zef by launching it as ./zef or /usr/src/zef/bin/zef.

        Launching the zef script as raku zef seems to indicate that some prerequisites are missing or that the raku search path is not set up correctly for launching this. Most likely you want to launch it as raku -Ilib bin/zef from the repository main directory, /usr/src/zef.

Re: [RAKU] How to install zef on Ubuntu 22.04
by Anonymous Monk on Jan 02, 2024 at 13:50 UTC
    Although there are still kind people on PerlMonks trying to answer Raku questions, I would not recommend PerlMonks as a place to ask questions about the Raku Programming Language.

    StackOverflow (https://stackoverflow.com/questions/tagged/raku) would be a better place, as well as Reddit (https://www.reddit.com/r/rakulang), or on IRC (#raku / #raku-beginner on Libera.chat), or on the Raku community on Discord (which is bridged to IRC).

    As I only visit PerlMonks for Raku content once a week while making the Rakudo Weekly News (https://rakudoweekly.blog/blog-feed/), I sadly did not see this question before.

    Claudio Ramirez is maintaining installable packages for many Linux distributions which include zef: https://nxadm.github.io/rakudo-pkg/ . Ubuntu is also supported. I recommend you go that route!

      These alternative suggestions may help with Polygots inability to install raku/zen, but won't deal with the underlying issue that Polygot seems unable to take advice on with UTF8. Perl 5 isn't the issue, Raku isn't the issue, the user is the issue.
        Actually, UTF8 is not the major issue...it's just one of the tipping points. I have no issues with my UTF8 code, other than tedium in keeping track of it and making sure any new code updates are UTF8 compliant. That tedium would be erased by an all-UTF8 solution, such as Raku offers.

        But the bigger issue for me is actually that my code has run into browser-related issues (browsers no longer work as they used to years ago when I started, and now force me to make changes). For example, I have never before used cookies; never needed them, nor wanted them (no need to post those massively annoying and now legally required cookie notices if not using them). Now I am experiencing anomalies because of my hidden-field data, and the updates are a massive headache when subroutines cannot accept named variables. Raku's subroutines do support named variables, which would solve this problem and make my code more maintainable and future-proof.

        Blessings,

        ~Polyglot~

      Thanks to additional information as to where to find these packages, I was able to correctly install zef after reinstalling rakudo. Apparently, even the rakudo package cannot be installed on Ubuntu 22.04 using the typical apt-get method, but when installed from the obscure site linked above (i.e. https://nxadm.github.io/rakudo-pkg/), zef can then also be installed and function correctly. Following this, I was able to install DBIish, but have had other demands on my time since then that have so far prevented me from testing the setup further. I believe, however, that the way forward now has a green light, and I thank you very much for providing this answer.
                                      |
                                      |
                                     _|_
                                   / ___ \
                                  / /___\ \
      \__________________________\    o    /__________________________/
       '----*-----|------|-----||-\       /-||-----|------|-----*----'
                 (O)    (O)   {▒▒} \_____/ {▒▒}   (O)    (O)
                                 O|OOo|oOO|O 
      
      Ready to fly again!
      

      Blessings,

      ~Polyglot~

Re: [RAKU] How to install zef on Ubuntu 22.04
by Polyglot (Chaplain) on Dec 29, 2023 at 05:39 UTC
    APPARENT SOLUTION

    This appears to be the only way to resolve this on Ubuntu 22.04 LTS (Jammy Jellyfish). The Repositories for Ubuntu 20.04 (Focal Fossa) must be added to the sources.list -- at least, this is what enabled me to install a "working" version of zef (which actually seems broken in terms of actually installing anything, due to failures on module repositories/dependencies, etc.).

    Start by navigating to the /etc/apt directory, then edit the sources.list file to include the following two lines:

    deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe m +ultiverse deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted univer +se multiverse

    Next, run:

    apt update
    After which an "apt-cache search zef" will return the perl6-zef module candidate (perl6-zef - Perl 6 package manager). Next:
    apt-get install perl6-zef
    ...and you should be in business--at least, I was...to the following results:
    apt-get install perl6-zef Reading package lists... Done Building dependency tree... Done Reading state information... Done The following NEW packages will be installed: perl6-zef 0 upgraded, 1 newly installed, 0 to remove and 100 not upgraded. Need to get 402 kB of archives. After this operation, 2,564 kB of additional disk space will be used. Get:1 http://archive.ubuntu.com/ubuntu focal/universe amd64 perl6-zef +all 0.8.2-1 [402 kB] Fetched 402 kB in 2s (232 kB/s) Selecting previously unselected package perl6-zef. (Reading database ... 417807 files and directories currently installed +.) Preparing to unpack .../perl6-zef_0.8.2-1_all.deb ... Unpacking perl6-zef (0.8.2-1) ... Setting up perl6-zef (0.8.2-1) ... Scanning processes... + + Scanning candidates... + + Scanning linux images... + + Restarting services...
    Apparently, however, there is no manual for zef.
    # man zef No manual entry for zef
    ...and it does not seem to have a complete list of Raku modules.
    # zef install DBIish ===> Searching for: DBIish ===> Updating cpan mirror: https://raw.githubusercontent.com/ugexe/Per +l6-ecosystems/master/cpan1.json ===> Updated cpan mirror: https://raw.githubusercontent.com/ugexe/Perl +6-ecosystems/master/cpan1.json ===> Updating p6c mirror: https://raw.githubusercontent.com/ugexe/Perl +6-ecosystems/master/p6c1.json ===> Updated p6c mirror: https://raw.githubusercontent.com/ugexe/Perl6 +-ecosystems/master/p6c1.json No candidates found matching identity: DBIish
    So...I still cannot install the one module I most need at present: DBIish.

    I may be back to Perl5 simply because Raku is too broken to use. :(

    Blessings,

    ~Polyglot~