I'm trying to update the current perl 5.34 verion to 5.38.3 in Zorin OS 17.2 core but can't seem to get it working. After every time i succesfully update perl (perl -v) to this version it jumps back to 5.34. What i'm i missing?
I moved your post from tutorials to general help, because your post is asking for help, not posting a guide tutorial. As to your question, I am not sure if you can update Perl, as per your kernel version. But lets wait for somebody else to chime in, who knows more about it.
Welcome to the Forum!
Comes this trhough a System Update and makes Problems? Or do You want insatll it manually? Because Zorin is an LTS Distro the Packages are a bit older. But the System and the Software are sitting on this older Dependencies. so, it wouldn't be the best Idea to change that without a really good Reason. Can You give us more Details what You want to do?
The Perl package that's available through the default software repositories is only available at 5.34 so it won't update further than that.
If you need a higher version, you can run your code inside a Docker container that has Perl at the appropriate version, install using the Update the software repositories or compile Perl from source code.
Compile from source
-
Download the source code archive, and extract it.
-
Navigate to the newly created folder with the same name, and take a look at the README file to understand what commands need to be run in the terminal.
-
Configure the compilation target and decide on a prefix, which is where your new binary will be located. I would suggest using
/usr/local/bin/perl
or$HOME/.local/bin
as those are standard locations typically used when compiling programs from source code, but you can of course use whatever you like../Configure -des -Dprefix=/usr/local/bin/perl
-
Run the compiler:
make test sudo make install
Note that the use of
sudo
here is dependent on the location you chose in the previous step. If choosing to install locally under the user's directory i.e.,$HOME/localperl
or$HOME/.local/bin
, you do not need to run as sudo.This will take a while, as it'll run some tests to make sure that everything is working as expected.
Homebrew package manager
-
Install a few required dependencies:
sudo apt-get install build-essential procps curl file git
-
Install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
Add Homebrew to your PATH variable:
test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)" test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.bashrc
-
Install Perl
brew install perl
Regardless of which method you prefer to use, please note that this will not replace the current binary located at /usr/bin/perl
. Any scripts that have the shebang line pointing to this location will use it. The easiest way around this is to create a symbolic link to right location
# First, create a backup of the current binary
sudo mv /usr/bin/perl /usr/bin/perl~
# Create a symbolic link. The location will vary depending on whether
# you compiled from source or installed through Homebrew
sudo ln -s /usr/local/bin/perl/bin/perl /usr/bin/perl
Repeat the same steps for associated binaries like perldoc
.