Apple's newest release of OS X, El Capitan, includes a security feature that hobbles some of the capabilities of root:
SIP. This includes preventing root from changing /usr/bin. This also prevents cpan from installing a new version of CPAN as seen here:
{s10:~} whoami
root
{s10:~} cpan CPAN
CPAN: Storable loaded ok (v2.41)
Reading '/var/root/.cpan/Metadata'
Database was generated on Thu, 08 Oct 2015 10:41:02 GMT
Running install for module 'CPAN'
Running make for A/AN/ANDK/CPAN-2.10.tar.gz
CPAN: Digest::SHA loaded ok (v5.84_01)
CPAN: Compress::Zlib loaded ok (v2.069)
Checksum for /var/root/.cpan/sources/authors/id/A/AN/ANDK/CPAN-2.10.ta
+r.gz ok
CPAN: File::Temp loaded ok (v0.23)
CPAN: Parse::CPAN::Meta loaded ok (v1.4417)
CPAN: CPAN::Meta loaded ok (v2.150005)
CPAN: Module::CoreList loaded ok (v3.03)
CPAN.pm: Building A/AN/ANDK/CPAN-2.10.tar.gz
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for CPAN
Writing MYMETA.yml and MYMETA.json
<snip>
All tests successful.
Files=30, Tests=701, 28 wallclock secs ( 0.39 usr 0.06 sys + 18.83 cu
+sr 3.16 csys = 22.44 CPU)
Result: PASS
ANDK/CPAN-2.10.tar.gz
/usr/bin/make test -- OK
Running make install
Manifying 2 pod documents
Manifying 16 pod documents
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!
ERROR: Can't create '/usr/bin'
Do not have write permissions on '/usr/bin'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!
at -e line 1.
make: *** [pure_perl_install] Error 1
ANDK/CPAN-2.10.tar.gz
/usr/bin/make install -- NOT OK
{s10:~}
I'm looking for suggestions on how to best work around this. It is possible to disable SIP but I'd prefer not to.
TIA