chown: cannot access `...' : No such file or directory

47,254

Solution 1

Just run:

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

Enter the password and it should work.

Solution 2

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.

Share:
47,254

Related videos on Youtube

Mohsen
Author by

Mohsen

Updated on September 18, 2022

Comments

  • Mohsen
    Mohsen almost 2 years

    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
    
    • Pilot6
      Pilot6 over 8 years
      Run it with sudo.
    • Pilot6
      Pilot6 over 8 years
      And what happened? Did you enter the password?
    • Mohsen
      Mohsen over 8 years
      yess , here it is: mossen@mossen-desktop:/opt/openfoam211/platforms/linux64GccD‌​POpt$ 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
    • Pilot6
      Pilot6 over 8 years
      You miss 64. ;-)
  • Mohsen
    Mohsen over 8 years
    i did so , but still have problem. mossen@mossen-desktop:/opt/openfoam211/platforms/linux64GccD‌​POpt$ 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
  • Pilot6
    Pilot6 over 8 years
    You use a wrong path.
  • Rik
    Rik over 8 years
    Note the difference between your current working dir that has linux64gccdpopt en the dir you try to chown that is just lunixgcc... (No 64)
  • coralvanda
    coralvanda over 7 years
    I was having the same error, and this was what worked for me. Thanks!