Comment(s)

I ran into an issue while customizing my new MacBook Pro where after installing the first Perl module the CPAN executable simply vanished (or at least appeared to!).

After some digging I discovered that the file permissions for a number of CPAN/Perl scripts had been modified at some point during the module installation and the 'execute' flag removed.

Below are a few of the affected executables in the /usr/bin directory, notice how the 'execute' bit isn't set:

-rw-rw-rw-  35 root   wheel       807 Jul  4 11:52 cpan
-rw-rw-rw-  35 root   wheel       807 Jul  4 11:52 cpan2dist
-rw-rw-rw-  35 root   wheel       807 Jul  4 11:52 cpanp
-rw-rw-rw-  35 root   wheel       807 Jul  4 11:52 cpanp-run-perl<!-- PELICAN_END_SUMMARY -->

Luckily OS X has a very handy and effective fix for this (versus manually resetting all the file permissions). Simply launch the Disk Utility app, select the proper disk volume, and under the First Aid section click on the 'Repair Disk Permissions'. The process took about 3 minutes to complete.

Disk Utility

Note

One oddity is that only two files are reported as being repaired in the output, but behind the scenes a large number of files were repaired.

Now if we check the file permissions again the execute permissions have been restored:

-rwxr-xr-x  35 root   wheel       807 Jul  4 11:26 cpan
-rwxr-xr-x  35 root   wheel       807 Jul  4 11:26 cpan2dist
-rwxr-xr-x  35 root   wheel       807 Jul  4 11:26 cpanp
-rwxr-xr-x  35 root   wheel       807 Jul  4 11:26 cpanp-run-perl

-Dave



Comments

comments powered by Disqus