2

I'm trying to change the ownership of a file on Ubuntu 10.04. This is the output from the terminal after typing in the following command:

mossen@mossen-desktop:/opt/openfoam211/platforms/linux64GccDPOpt$ ls
bin  lib
mossen@mossen-desktop:/opt/openfoam211/platforms/linux64GccDPOpt$ chown -R -H mossen:mossen '/opt/openfoam211/platforms/linuxGccDPOpt/lib'
chown: cannot access `/opt/openfoam211/platforms/linuxGccDPOpt/lib': No such file or directory
  • Run it with sudo. – Pilot6 Feb 5 '16 at 12:27
  • i did that . didn't work – Mohsen Feb 5 '16 at 12:30
  • And what happened? Did you enter the password? – Pilot6 Feb 5 '16 at 12:33
  • yess , here it is: mossen@mossen-desktop:/opt/openfoam211/platforms/linux64GccDPOpt$ sudo chown -R -H mossen:mossen '/opt/openfoam211/platforms/linuxGccDPOpt/lib' [sudo] password for mossen: chown: cannot access `/opt/openfoam211/platforms/linuxGccDPOpt/lib': No such file or directory – Mohsen Feb 5 '16 at 12:34
  • You miss 64. ;-) – Pilot6 Feb 5 '16 at 12:37
1

Just run:

sudo chown -R mossen:mossen /opt/openfoam211/platforms/linux64GccDPOpt/lib

Enter the password and it should work.

  • i did so , but still have problem. mossen@mossen-desktop:/opt/openfoam211/platforms/linux64GccDPOpt$ sudo chown -R -H mossen:mossen '/opt/openfoam211/platforms/linuxGccDPOpt/lib' [sudo] password for mossen: chown: cannot access `/opt/openfoam211/platforms/linuxGccDPOpt/lib': No such file or directory – Mohsen Feb 5 '16 at 12:36
  • You use a wrong path. – Pilot6 Feb 5 '16 at 12:37
  • Note the difference between your current working dir that has linux64gccdpopt en the dir you try to chown that is just lunixgcc... (No 64) – Rik Feb 5 '16 at 12:39
1

You are doing it the windows way or something try:

sudo chown -R mossen:mossen ./lib

The -H is for changing symbolic links, the -R is for recursively changing sub folders the ./ means start here se output of your ls command. The quotes are used to fix names with white spaces of which you have none. Try this and remember the KISS rule: Keep It Simple Stupid There is no need to starte every command from the root, you risk affecting library's that was better left alone.

  • I was having the same error, and this was what worked for me. Thanks! – coralvanda Dec 3 '16 at 12:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.