djamps / migrate-vm

29 stars 16 forks source link

Can't locate Number/Format.pm #11

Closed gudge25 closed 6 years ago

gudge25 commented 6 years ago

Xenserver [root@xenserver-asterisk migrate-vm-master]# cat /etc/redhat-release XenServer release 6.1.0-59235p (xenenterprise)

PERL [root@xenserver-asterisk migrate-vm-master]# perl -v

This is perl, v5.8.8 built for i386-linux-thread-multi

RUN [root@xenserver-asterisk migrate-vm-master]# ./migratevm.pl Can't locate Number/Format.pm in @INC (@INC contains: ./lib /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at lib/Xen/API.pm line 7. BEGIN failed--compilation aborted at lib/Xen/API.pm line 7. Compilation failed in require at ./migratevm.pl line 4. BEGIN failed--compilation aborted at ./migratevm.pl line 4.

When i am trying to install perl module

[root@xenserver-asterisk migrate-vm-master]# cpan Number::Format CPAN: Storable loaded ok Going to read /root/.cpan/Metadata Database was generated on Tue, 10 Jul 2018 23:54:51 GMT Running install for module Number::Format Running make for W/WR/WRW/Number-Format-1.75.tar.gz CPAN: Digest::MD5 loaded ok CPAN: Compress::Zlib loaded ok Checksum for /root/.cpan/sources/authors/id/W/WR/WRW/Number-Format-1.75.tar.gz ok Scanning cache /root/.cpan/build for sizes Number-Format-1.75/ Number-Format-1.75/CHANGES Number-Format-1.75/Format.pm Number-Format-1.75/Makefile.PL Number-Format-1.75/MANIFEST Number-Format-1.75/META.json Number-Format-1.75/META.yml Number-Format-1.75/README Number-Format-1.75/t/ Number-Format-1.75/TODO Number-Format-1.75/t/format_bytes.t Number-Format-1.75/t/format_negative.t Number-Format-1.75/t/format_number.t Number-Format-1.75/t/format_picture.t Number-Format-1.75/t/format_price.t Number-Format-1.75/t/locale.t /bin/tar: Read 7680 bytes from - Number-Format-1.75/t/object.t Number-Format-1.75/t/round.t Number-Format-1.75/t/unformat_number.t Removing previously used /root/.cpan/build/Number-Format-1.75

CPAN.pm: Going to build W/WR/WRW/Number-Format-1.75.tar.gz

Checking if your kit is complete... Looks good Writing Makefile for Number::Format cp Format.pm blib/lib/Number/Format.pm Manifying blib/man3/Number::Format.3pm /usr/bin/make -- OK Running make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/format_bytes.......

Failed test 'use Number::Format;'

at t/format_bytes.t line 10.

t/format_bytes.......NOK 1# Tried to use 'Number::Format'.

Error: Perl v5.10.0 required--this is only v5.8.8, stopped at /root/.cpan/build/Number-Format-1.75/blib/lib/Number/Format.pm line 5.

Compilation failed in require at t/format_bytes.t line 10.

BEGIN failed--compilation aborted at t/format_bytes.t line 10.

Undefined subroutine &main::format_bytes called at t/format_bytes.t line 12.

Looks like your test exited with 255 just after 1.

think i should upgrade perl but i dont have Perl v5.10.0 in repo -- need adwice how to do that in a moust secure way THANKS

steaksauce- commented 6 years ago

Since XenServer 6.x is based on Cent/RHEL 5.x, you can do a couple of things to upgrade perl: Option 1: Add the historical repo. Below is how we add it in: ''' [base] name=CentOS-$releasever - Base

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os

baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/

baseurl=http://vault.centos.org/5.11/os/x86_64/

baseurl=http://vault.centos.org/$releasever/centosplus/$basearch/

gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 exclude=kernel-xen, xen* enabled=1 '''

Option 2: Locate the version of Perl you need online and use wget to grab it.

By far the easiest way is adding the repo.

djamps commented 6 years ago

Just use the binary instead of trying to meet the dependency hell on Xenserver itself: https://djlab.com/2013/01/migrate-a-xenserver-vm-without-a-pool-or-shared-storage/