albertomario

Registered
Dec 4, 2010
2
0
51
I have installed CPanel Optimized3 VPS on my VPS and i get this error when is restarted.
Code:
/scripts/fixeverything: /usr/bin/perl: bad interpreter: Too many levels of symbolic links
Everytime when i try to run any command i get this.
If the server is not restared, is not any problem....got this only when i try to restart....and everything is messed up.
 

jacobt

Registered
Dec 22, 2010
3
0
51
I solved with
Code:
rm /usr/bin/perl
cp /usr/bin/perl5.8.8 perl
Thank you for this, it worked for me too! cPanel services would not start because of this perl error. Apparently there is a symlink linking to another symlink somewhere in there, causing a loop.

Your fix worked for me. Just in case anyone doesn't realize where the working directory should be when you run that code, you should be in: /usr/bin/

So, just run this to be safe:

Code:
rm /usr/bin/perl
cp /usr/bin/perl5.8.8 /usr/bin/perl
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
42
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Hello,

Please do not run an rm of perl on the machine. If the only binary that exists on your machine is /usr/bin/perl, you will have effectively wiped out perl on the machine and then be unable to install it using our installer even.

1. Never use rm on a machine without first checking if another binary copy does exist
2. Never rm if possible, move the copy instead

The better method here is to do the following:

Code:
ls -lah /usr/bin/perl /usr/local/bin/perl
If you see /usr/bin/perl symlinked from /usr/local/bin/perl, then it is setup properly. If you see /usr/bin/perl symlinked from somewhere else, then it isn't. Here's what it should show when it is setup right basically:

Code:
[email protected] [~]# ls -lah /usr/bin/perl /usr/local/bin/perl
lrwxrwxrwx  1 root root  17 Dec 25  2009 /usr/bin/perl -> /usr/local/bin/perl*
-rwxr-xr-x  2 root root 13K Dec 25  2009 /usr/local/bin/perl*
You should move /usr/bin/perl and then properly symlink it if it isn't showing this type of setup. Again, move the file do not remove it using this step for moving it:

Code:
mv /usr/bin/perl /usr/bin/perl.bak
I cannot post the other steps as they are dependent on whether you have two copies of perl's binary (one at /usr/bin/perl and one at /usr/local/bin/perl), or whether you have /usr/bin/perl symlinked to /usr/local/bin/perl instead of the other way around. I've given steps before and had someone not check if it was two binaries or a symlink and blindly copy the steps, which is not the ideal situation to pursue unfortunately.

As such, if you aren't certain the steps, post the output for "ls -lah /usr/bin/perl /usr/local/bin/perl" and then I would be happy to provide the appropriate steps for your situation.

Thanks!