Having issues copying pig to Local directory.


I was refering to Pig Installation manual for Apache Hadoop, at step 3 I got error for Permission Denied to create a folder in Local directory.

drwxr-xr-x 15 cloudera cloudera 4096 Apr 5 2014 pig-0.12.1
-rw-rw-r-- 1 cloudera cloudera 5465103 Mar 29 10:45 shakespeare.txt
-rw-rw-r-- 1 cloudera cloudera 412678 Mar 29 10:45 tom_sawyer.txt
-rw-rw-r-- 1 cloudera cloudera 2241335 Mar 29 10:46 wealth_of_nations.txt
-rw-rw-r-- 1 cloudera cloudera 59445085 Apr 19 10:50 pig-0.12.1.tar.gz
[cloudera@localhost kc]$ cp -rf pig-0.12.1 /usr/local/pig
cp: cannot create directory `/usr/local/pig': Permission denied

Only root user has full rights.
drwxr-xr-x. 14 root root 4096 Jun 1 2014 local

What's the solution?

Thanks in Advance

2 Answer(s)


hi Komil,

You are trying to copy files to "root" owned directories and would need "sudo" access to do that. But be careful whenever you invoke "sudo"

modify your command to
sudo cp -rf pig-0.12.1 /usr/local/pig



Thanks, was able to move to next step... but now getting an error on next step.


`[cloudera@localhost kc]$ chown hduser:hadoop -R /usr/local/pig
chown: invalid user: `hduser:hadoop'