0

I am working in a CentOS environment and am setting up perlbrew (App::perlbrew/0.87) locally. I've essentially been following the steps here. I have set up perlbrew similarly in the past and no issues, but now am having a strange problem. It is worth noting that I was able to set up perlbrew and install perl locally on the same machine, same environment, for a different user.

The problem is this, perlbrew is installed, but cannot install any version of perl because after downloading the dist it fails to extract the tar.gz.

Here is some information about the install. Perlbrew and cpanm seem to be in place and functioning fine.

-bash-4.1$ env | grep PERL
PERLBREW_SHELLRC_VERSION=0.87
PERLBREW_ROOT=/my/home/dir/perl5/perlbrew
PERLBREW_HOME=/my/home/dir/.perlbrew

-bash-4.1$ env | grep perl
OLDPWD=/my/home/dir/perl5/perlbrew
PERLBREW_ROOT=/my/home/dir/perl5/perlbrew
PATH=/my/home/dir/perl5/perlbrew/bin:/usr/local/bin:/bin:...
PWD=/my/home/dir/perl5/perlbrew/dists
PERLBREW_HOME=/my/home/dir/.perlbrew

-bash-4.1$ which perlbrew
~/perl5/perlbrew/bin/perlbrew


My .bash_profile contains only: 
source ~/perl5/perlbrew/etc/bashrc

-bash-4.1$ perlbrew available

   perl-5.31.6   
   perl-5.30.1   
   perl-5.28.2   
   perl-5.26.3   
   perl-5.24.4   
   ...

However, when I try to install, I start getting errors from tar.

-bash-4.1$ perlbrew install perl-5.30.1
tar: perl-5.30.1/.dir-locals.el: Cannot close: Permission denied
tar: perl-5.30.1/.dir-locals.el: Cannot utime: Permission denied
tar: perl-5.30.1/.lgtm.yml: Cannot close: Permission denied
tar: perl-5.30.1/.lgtm.yml: Cannot utime: Permission denied
...
it goes on and on for every file.

I think the key output here is:

Failed to extract /my/home/dir/perl5/perlbrew/dists/perl-5.30.1.tar.gz at /my/home/dir/perl5/perlbrew/bin/perlbrew line 1631

If I navigate to where perlbrew downloads the dist and try to extract it manually, it fails.

-bash-4.1$ cd /my/home/dir/perl5/perlbrew/dists/
-bash-4.1$ ll
total 17308
drwxrwxrwx. 4 myUserID myGroup    11776 Dec  2 15:10 perl-5.30.1
-rwxrwxrwx. 1 myUserID myGroup 17712574 Nov 25 14:46 perl-5.30.1.tar.gz

-bash-4.1$ tar -xvf perl-5.30.1.tar.gz 
perl-5.30.1/
perl-5.30.1/.dir-locals.el
tar: perl-5.30.1/.dir-locals.el: Cannot close: Permission denied
tar: perl-5.30.1/.dir-locals.el: Cannot utime: Permission denied
perl-5.30.1/.lgtm.yml
tar: perl-5.30.1/.lgtm.yml: Cannot close: Permission denied
tar: perl-5.30.1/.lgtm.yml: Cannot utime: Permission denied
perl-5.30.1/.metaconf-exclusions.txt


The perl-5.30.1 directory is created and files are made but they are not really extracted. It's just full of 0kb files where everything should be.

I've tested tar by creating tarballs from files I create and zipping and unzipping and whatnot, everything seems to work there fine. All the files are owned by my user/group, so I don't get why I can't extract this file.

Does anyone know what could be the cause of this behavior?

EDIT: This was actually done on a different machine configured the same way as it turns out! I want to note again that I was able to successfully perform the install on a different user by the same method on the same machine and didn't run into this issue.

One user, @DavidMitchell commented about additional permissions shown by ls -lZ that might influence things. Note that I am using SGE on this machine and have to qlogin to process most tasks.

Before and after qlogins:

In the perl/dist folder before qlogin.
-bash-4.1$ ls -lZ
-rwxrwxrwx. myUser myGroup system_u:object_r:nfs_t:s0       perl-5.30.1.tar.gz

AFTER qlogin
-bash-4.2$ ls -lZ
-rwxrwxrwx myUser MyGroup ?                                perl-5.30.1.tar.gz

So there's a '?' there, so that's interesting. I checked on another machine and user with successful installation and it seems to show the same thing though, so maybe this isn't the issue. Will continue to look into it further, appreciate any further advice!

2
  • Have you tried -zxvf when extracting manually rather than just -xvf ? (it looks zip'd as well as tar'd)
    – Smock
    Commented Dec 3, 2019 at 16:06
  • Yes I have. Apparently, the GNU tar auto-detects the use of gzip when reading from a file (based on extension?), making -z optional in that situation. (If a missing -z flag was the issue, tar wouldn't be able to read the archive at all.). I have tried it though nonetheless.
    – Price
    Commented Dec 3, 2019 at 16:46

0

You must log in to answer this question.

Browse other questions tagged .