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

So I may or may not have broken my Perl/CPAN installation. I honestly don't use either that much, but I need to use it now to run a game server on my VPS. The instructions say to downgrade Perl to 5.14.4, with these commands:

sudo cpan App::perlbrew perlbrew init perlbrew install perl-5.14.4 perlbrew switch perl-5.14.4
I ran the first one, and I get this error:
Loading internal null logger. Install Log::Log4perl for logging messag +es Reading '/Metadata' Database was generated on Mon, 01 Apr 2019 07:17:03 GMT Running install for module 'App::perlbrew' Checksum for yes/authors/id/G/GU/GUGOD/App-perlbrew-0.86.tar.gz ok Cannot gzopen yes/authors/id/G/GU/GUGOD/App-perlbrew-0.86.tar.gz: cann +ot open file 'yes/authors/id/G/GU/GUGOD/App-perlbrew-0.86.tar.gz': No + such file or directory Cannot gzopen yes/authors/id/G/GU/GUGOD/App-perlbrew-0.86.tar.gz: cann +ot open file 'yes/authors/id/G/GU/GUGOD/App-perlbrew-0.86.tar.gz': No + such file or directory Directory 'yes/GUGOD-lhfQ4l' has gone. Cannot continue.
I tried to do this same thing a couple months ago, and when I was configuring CPAN, I kind of just held enter for most of the options. It's foggy, but I think some of those were asking which the directory to save stuff in was, to which I guess the default answer was just "yes". This broke cpan already so I gave up on the project, then a few months later I must've deleted the "yes" folder it made. I can no longer use CPAN. I tried uninstalling Perl but I guess that breaks stuff on Ubuntu so I didn't. A few months later, I'd like to try to install this game server again, but I'm running into the same issue. How do I fix my CPAN installation?

Replies are listed 'Best First'.
Re: Fixing my CPAN installation
by marto (Cardinal) on Apr 02, 2019 at 06:37 UTC

    "I tried uninstalling Perl but I guess that breaks stuff on Ubuntu so I didn't"

    Firstly, are you sure the system perl is ok? If not you may have to consider either trying to fix it, or reinstalling perl. You can install perlbrew either by simply following the instructions on the homepage, or use you'd OS package manager to do so, sudo apt install perlbrew.

Re: Fixing my CPAN installation
by haukex (Archbishop) on Apr 02, 2019 at 06:35 UTC

    On perlbrew.pl, you can find instructions for how to install perlbrew directly, without having to go through cpan, for example:

    \wget -O - https://install.perlbrew.pl | bash

    As for cleaning up, you might want to check your environment variables in e.g. ~/.profile and ~/.bashrc whether there's anything Perl-related being set there, and also the AM's suggestion of deleting ~/.cpan should reset its configuration and build cache (the same goes for ~/.cpanm).

Re: Fixing my CPAN installation
by ikegami (Patriarch) on Apr 02, 2019 at 10:54 UTC

    Delete (rename) ~/.cpan/CPAN/MyConfig.pm.

    I believe running o conf init from within the cpan tool has the same effect.

    Alternatively, you can run o conf from within the cpan tool to see the list of config options, and o conf {key} {val} to fix the incorrect value.

Re: Fixing my CPAN installation
by Anonymous Monk on Apr 02, 2019 at 03:49 UTC

    I have not used perlbrew; am unfamiliar how it munges things.

    You could try using cpan from scratch by removing ($HOME/.cpan and/or) $HOME/.cpan/CPAN/MyConfig.pm or equivalent (directory) file.