Solved

Install parallel Perl on Debian

Posted on 2003-11-09
12
658 Views
Last Modified: 2012-06-22
Hello
I installing perl5.8.1 in my box "Debian woody, 2.4.21".
since debian has it's perl-dist-package 5.6.1, I followed the instruction on to install 5.8.1 as well. http://perlmonks.thepen.com/285799.html

username@domain:~$wget http://cpan.org/src/stable.tar.gz
username@domain:~$tar -zxvf stable.tar.gz
username@:~$cd perl-5.8.1
username@domain:~/perl-5.8.1$rm -f config.sh Policy.sh
username@domain:~/perl-5.8.1$sh Configure -de
username@domain:~/perl-5.8.1$make
username@domain:~/perl-5.8.1$make test
username@domain:~/perl-5.8.1$make install


4.confirm new Perl 5.8.0 is user Perl
$perl -e 'print "$]\n";' #should tell you "5.008".
it shows 5.006

rm -f /usr/bin/perl
ln -sf /usr/local/bin/perl /usr/bin/perl

$perl -e 'print "$]\n";'
$bash: -e: command not found

my question, why the last command not showing 5.008

did I install the file in the correct place or should have been installed in a different place?
username@domain:/usr/local$ and not username@domain:~$

current look

$/bin/su
# rm -f /usr/bin/perl
# ln -sf /usr/local/bin/perl /usr/bin/perl
# perl -e 'print "$]\n";'
bash: perl: command not found
# perl -e 'print "$]\n";'
bash: perl: command not found
#

domain:/usr/bin# ls -l | grep perl
-rwxr-xr-x    1 root     root        22903 Aug 10 11:18 find2perl
lrwxrwxrwx    1 root     root           19 Nov 10 07:48 perl -> /usr/local/bin/perl
-rwxr-xr-x    2 root     root       774947 Aug 10 11:19 perl-5.6
-rwxr-xr-x    2 root     root       774947 Aug 10 11:19 perl5.6.1
-rwxr-xr-x    1 root     root        35465 Aug 10 11:18 perlbug
-rwxr-xr-x    1 root     root        16920 Aug 10 11:18 perlcc
-rwxr-xr-x    1 root     root        22696 Aug 10 11:18 perldoc
-rwxr-xr-x    1 root     root          121 Aug 10 11:19 perldoc.stub
domain:/usr/bin# ls -l /usr/local/bin/ | grep perl
lrwxrwxrwx    1 root     staff           9 Nov 10 07:57 perl -> perl5.8.0
domain:/usr/bin#C-d
username@domain:~$ls -l | grep perl
drwxr-xr-x   32 username    username        8192 Nov  7 20:12 perl-5.8.1
username@demain:~$



thanks
0
Comment
Question by:samj
12 Comments
 
LVL 20

Expert Comment

by:jmcg
ID: 9712101
Something's certainly not quite right. Most of your steps seem okay, but it seems curious that you have a link named /usr/local/bin/perl pointing to perl5.8.0 -- if what you were installing was perl5.8.1.

The step

sh Configure -de

causes the configure script to accept the default answer to every question. This is the place where I suspect things went wrong.

For now, I suggest that you locate the Perl executable that should be in the perl-5.8.1 directory as a result of your compilation. Copy that file to /usr/local/bin/perl.5.8.1. Then do

rm /usr/local/bin/perl;
ln -s perl5.8.1 /usr/local/bin/perl

If you cannot find the new perl5.8.1 executable, I recommend that you first put back the symlink pointing to your perl5.6.1:

rm /usr/bin/perl;
ln -s perl5.6.1 /usr/bin/perl


==============

Once you have things stabilized, you can go back to your perl-5.8.1 directory and start over, but leave out the -de

sh Configure

This time, pay attention to what its asking and make sure you like the default answer before saying "yes".

0
 
LVL 2

Expert Comment

by:rootkiddy
ID: 9712201
Ok.  I believe I see your problem.  Below is the section I'm looking at.  With comments beside each part.  Basically it looks like your removed the link in /usr/bin/perl and linked it to /usr/local/bin/perl.  In return /usr/local/bin/perl is linked to /usr/local/bin/perl5.8.0 which doesn't exist.  What you probably meant to do was link to the home directory of the user account that you installed perl in.  Or you may have meant to do the make install as root and installed it within another location other than that users home directory.  Also just to make sure you are aware that when you just type perl in will use the first instance of perl found within your path.  You can double check that by running "echo $PATH" or "env" from the commandline.  Note that you can also check whether the above was correct by running /usr/local/bin/perl5.8.0 and see what you get.  Good luck and let me know if this helps.

$/bin/su
# rm -f /usr/bin/perl
# ln -sf /usr/local/bin/perl /usr/bin/perl
# perl -e 'print "$]\n";'
bash: perl: command not found
# perl -e 'print "$]\n";'                    # Comment: You linked to something that doesn't exist.  Below is more information.
bash: perl: command not found
#

domain:/usr/bin# ls -l | grep perl
-rwxr-xr-x    1 root     root        22903 Aug 10 11:18 find2perl
lrwxrwxrwx    1 root     root           19 Nov 10 07:48 perl -> /usr/local/bin/perl
-rwxr-xr-x    2 root     root       774947 Aug 10 11:19 perl-5.6
-rwxr-xr-x    2 root     root       774947 Aug 10 11:19 perl5.6.1
-rwxr-xr-x    1 root     root        35465 Aug 10 11:18 perlbug
-rwxr-xr-x    1 root     root        16920 Aug 10 11:18 perlcc
-rwxr-xr-x    1 root     root        22696 Aug 10 11:18 perldoc
-rwxr-xr-x    1 root     root          121 Aug 10 11:19 perldoc.stub
domain:/usr/bin# ls -l /usr/local/bin/ | grep perl
lrwxrwxrwx    1 root     staff           9 Nov 10 07:57 perl -> perl5.8.0          # Comment: perl5.8.0 is not in the current dir
domain:/usr/bin#C-d
username@domain:~$ls -l | grep perl
drwxr-xr-x   32 username    username        8192 Nov  7 20:12 perl-5.8.1   # Comment: This appears to be in your home directory
username@demain:~$
0
 

Author Comment

by:samj
ID: 9713086
username@box:~/perl-5.8.1$ ls -l | grep perl
some of the files not all are posted
-rwxr-xr-x    1 username    username        3180 Nov  7 19:57 makeaperl
-r-xr-xr-x    1 username    username        3909 Sep  2 23:41 makeaperl.SH
-rwxr-xr-x    1 username    username      897279 Nov  7 20:00 miniperl
-r--r--r--    1 username    username        2850 Sep  2 23:41 miniperlmain.c
-rw-r--r--    1 username    username        1524 Nov  7 19:58 miniperlmain.o
-rwxr-xr-x    1 username    username      978123 Nov  7 20:00 perl
-r--r--r--    1 username    username      115587 Sep 12 07:42 perl.c
-r--r--r--    1 username    username      128491 Sep 25 06:50 perl.h
-rw-r--r--    1 username    username       61920 Nov  7 19:58 perl.o
-rw-r--r--    1 username    username        1674 Sep 25 21:06

username@box:~/perl-5.8.1$
$cp /perl-5.8.1/perl /usr/local/bin/perl.5.8.1
$rm /usr/local/bin/perl
$ln -s perl5.8.1 /usr/local/bin/perl
$ perl prog/play.pl
bash: /usr/bin/perl: No such file or directory
$ /bin/su
Password:
~# rm /usr/bin/perl
~# ln -s perl5.6.1 /usr/bin/perl
$ /usr/bin/perl5.6.1
print 1;
1:~$
$cd perl-5.8.1
0
 

Author Comment

by:samj
ID: 9713103
please concate this to the previous post.
$rm -f config.sh Policy.sh
$sh Configure
...whole bunch of questions
Directories to use for library searches? [/usr/local/lib /lib /usr/lib] /usr/local/lib
Installation prefix to use? (~name ok) [/usr/local]

.$make
...whole bunch of lines
libperl.a(pp.o): In function `Perl_pp_pow':
pp.o(.text+0x1e22): undefined reference to `pow'
libperl.a(pp.o): In function `Perl_pp_sin':
pp.o(.text+0x5b08): undefined reference to `sin'
libperl.a(pp.o): In function `Perl_pp_cos':
pp.o(.text+0x5c0c): undefined reference to `cos'
libperl.a(pp.o): In function `Perl_pp_exp':
pp.o(.text+0x5e0c): undefined reference to `exp'
libperl.a(pp.o): In function `Perl_pp_log':
pp.o(.text+0x5f4d): undefined reference to `log'
libperl.a(pp.o): In function `Perl_pp_sqrt':
pp.o(.text+0x60a3): undefined reference to `sqrt'
collect2: ld returned 1 exit status
make: *** [miniperl] Error 1
:~/perl-5.8.1$

should I go with
$make test
$make install

what about this Error 1 thing?

thanks
0
 
LVL 20

Expert Comment

by:jmcg
ID: 9714891
No, to try to proceed from that point will be futile. You need to correct the problem in the first make.
Unfortunately, I don't see, from the bit of the transcript that you posted, what the error is. Something went wrong in specifying the math library, perhaps?

0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:samj
ID: 9716690
how do I fix that?
0
 
LVL 20

Expert Comment

by:jmcg
ID: 9718696
I'm afraid fixing it involves spotting the place in the "Configure" conversation where the math library is being selected and selecting the "right" choice instead of whatever happened last time. I don't know for that particular Linux distribution whether you want "-lm" or some other flag to be given to the loader, so that the entry points into the math library will be properly resolved.

Someone who knows the Debian package system better than me could probably point you to a 5.8.1 that's already built -- but I don't know where to send you for that.
0
 

Author Comment

by:samj
ID: 9732574
ok.
problem fix.. thanks to all the comments

reboot, login as root into a kde, open a console window
# cd /home/username
# tar -zxvf stable.tar.gz #previously optained with wget http://cpan.org/src/stable.tar.gz
# cd perl-5.8.1
# sh Configure -de
# make
# make test
# make install


# ln -sf perl5.6.1 /usr/bin/perl
# ln -sf perl5.8.1 /usr/local/bin/perl
# /usr/bin/perl -v

This is perl, v5.6.1 built for i686-linux
<snip>

# /usr/local/bin/perl -v

This is perl, v5.8.1 built for i686-linux
<snip>

0
 
LVL 20

Expert Comment

by:jmcg
ID: 9733071
Sorry for all the diversions along the way.

Just a "redo" solved it?

The last two ln commands are things that the "make install" step should have handled in a normal setup, but here, where you explictly want two different versions of perl installed, your approach looks to be as good as any.
0
 
LVL 20

Expert Comment

by:jmcg
ID: 9736267
No objection whatsoever.
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 9754216
PAQed, with points refunded (100)

Computer101
E-E Admin
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now