Fix for BBBlu Linux perl,cpan,locale problems

I’m using this install on BBBlu
I’m using this image.

I got arducopter working with qgroundstation.
I wanted to run up some perl scripts that I have used on the raspberrypi.
I have had a fun day trying to work out why I cant use cpan to load perl modules.

It comes up with
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = “pl_PL.UTF-8”
are supported and installed on your system.

After much searching I found a fix.
It looks like the locale aren’t installed or broken.
Here’s the fix:

sudo apt-get purge locales
sudo apt-get install locales
sudo dpkg-reconfigure locales

During the last, it will ask you to pick your locale.
Just pick the one that’s a match for your country.

After that I loaded latest cpan.
But had to install build-essential

sudo apt-get install build-essential

sudo cpan
install CPAN
reload CPAN
quit

After this everything worked fine.

I spent a number of hours debugging this problem so I thought would share to save others the pain.

Thanks for sharing !
Normally, the locales issue fix is easy to find on search engine !