地方エンジニアの学習日記

興味ある技術の雑なメモだったりを書いてくブログ。たまに日記とガジェット紹介。

Can't locate CPAN.pm in @INC

$ perl -MCPAN -e "\$CPAN::Defaultsite='http://ftp.kddilabs.jp/CPAN/';shell"
Can't locate CPAN.pm in @INC (you may need to install the CPAN module) (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5).
BEGIN failed--compilation aborted.

cpanって勝手にデフォルトで入ってるものだと思ってた。

Name         : perl-CPAN
Version      : 2.18
Release      : 397.el8
Architecture : noarch
Size         : 1.7 M
Source       : perl-CPAN-2.18-397.el8.src.rpm
Repository   : @System
From repo    : AppStream
Summary      : Query, download and build perl modules from CPAN sites
URL          : http://search.cpan.org/dist/CPAN/
License      : GPL+ or Artistic
Description  : The CPAN module automates or at least simplifies the make and install of
             : perl modules and extensions. It includes some primitive searching
             : capabilities and knows how to use LWP, HTTP::Tiny, Net::FTP and certain
             : external download clients to fetch distributions from the net.

dnfコマンドでインストールしたら解決。いっぱいついてきた。

$ dnf install -y perl-cpan
Installed:
  perl-CPAN-2.18-397.el8.noarch                    perl-Encode-Locale-1.05-9.el8.noarch                    annobin-8.90-1.el8.0.1.x86_64                        dwz-0.12-9.el8.x86_64                                  efi-srpm-macros-3-2.el8.noarch
  ghc-srpm-macros-1.4.2-7.el8.noarch               go-srpm-macros-2-16.el8.noarch                          ocaml-srpm-macros-5-4.el8.noarch                     openblas-srpm-macros-2-2.el8.noarch                    perl-Algorithm-Diff-1.1903-9.el8.noarch
  perl-Archive-Tar-2.30-1.el8.noarch               perl-Archive-Zip-1.60-3.el8.noarch                      perl-CPAN-Meta-2.150010-396.el8.noarch               perl-CPAN-Meta-Requirements-2.140-396.el8.noarch       perl-CPAN-Meta-YAML-0.018-397.el8.noarch
  perl-Compress-Bzip2-2.26-6.el8.x86_64            perl-Compress-Raw-Bzip2-2.081-1.el8.x86_64              perl-Compress-Raw-Zlib-2.081-1.el8.x86_64            perl-Data-OptList-0.110-6.el8.noarch                   perl-Data-Section-0.200007-3.el8.noarch
  perl-Devel-Size-0.81-2.el8.x86_64                perl-Digest-SHA-1:6.02-1.el8.x86_64                     perl-ExtUtils-CBuilder-1:0.280230-2.el8.noarch       perl-ExtUtils-Command-1:7.34-1.el8.noarch              perl-ExtUtils-Install-2.14-4.el8.noarch
  perl-ExtUtils-MM-Utils-1:7.34-1.el8.noarch       perl-ExtUtils-MakeMaker-1:7.34-1.el8.noarch             perl-ExtUtils-Manifest-1.70-395.el8.noarch           perl-ExtUtils-ParseXS-1:3.35-2.el8.noarch              perl-File-HomeDir-1.002-4.el8.noarch
  perl-File-Which-1.22-2.el8.noarch                perl-IO-Compress-2.081-1.el8.noarch                     perl-IO-Zlib-1:1.10-416.el8.noarch                   perl-IPC-Cmd-2:1.02-1.el8.noarch                       perl-JSON-PP-1:2.97.001-3.el8.noarch
  perl-Locale-Maketext-1.28-396.el8.noarch         perl-Locale-Maketext-Simple-1:0.21-416.el8.noarch       perl-MRO-Compat-0.13-4.el8.noarch                    perl-Module-Build-2:0.42.24-5.el8.noarch               perl-Module-CoreList-1:5.20181130-1.el8.noarch
  perl-Module-Load-1:0.32-395.el8.noarch           perl-Module-Load-Conditional-0.68-395.el8.noarch        perl-Module-Metadata-1.000033-395.el8.noarch         perl-Net-Ping-2.55-416.el8.noarch                      perl-Package-Generator-1.106-11.el8.noarch
  perl-Params-Check-1:0.38-395.el8.noarch          perl-Params-Util-1.07-22.el8.x86_64                     perl-Perl-OSType-1.010-396.el8.noarch                perl-Pod-Html-1.22.02-416.el8.noarch                   perl-Software-License-0.103013-2.el8.noarch
  perl-Sub-Exporter-0.987-15.el8.noarch            perl-Sub-Install-0.928-14.el8.noarch                    perl-Test-Harness-1:3.42-1.el8.noarch                perl-Text-Diff-1.45-2.el8.noarch                       perl-Text-Glob-0.11-4.el8.noarch
  perl-Text-Template-1.51-1.el8.noarch             perl-Time-HiRes-1.9758-1.el8.x86_64                     perl-devel-4:5.26.3-416.el8.x86_64                   perl-inc-latest-2:0.500-9.el8.noarch                   perl-local-lib-2.000024-2.el8.noarch
  perl-srpm-macros-1-25.el8.noarch                 perl-version-6:0.99.24-1.el8.x86_64                     python-srpm-macros-3-38.el8.noarch                   python3-rpm-macros-3-38.el8.noarch                     qt5-srpm-macros-5.12.5-3.el8.noarch
  redhat-rpm-config-122-1.el8.noarch               rust-srpm-macros-5-2.el8.noarch                         systemtap-sdt-devel-4.2-6.el8.x86_64                 perl-Math-BigInt-1:1.9998.11-7.el8.noarch              perl-Math-Complex-1.59-416.el8.noarch