2

I was installing a few softwares which prompted that :

Download is performed unsandboxed as root as file couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)

So I did:

sudo chown -Rv _apt:root /home/kpate352/ sudo chmod -Rv 700 /home/kpate352/

But now everything is messed up. I couldn't view my files and it prompts "Permission denied". I also tried doing:

sudo chown -R kpate352:kpate352 /home/kpate352

But it returns nothing. How to undo the following commands:

sudo chown -Rv _apt:root /home/kpate352/ sudo chmod -Rv 700 /home/kpate352/

  • "But it returns nothing" is the normal behavior for success. That command's output should only be error messages, if any. – user535733 Mar 10 at 16:29
4

Unfortunately you can't undo the changes made by chown or chmod. That's linux! Commands will actually do what you tell them to do. Better do a backup yourself next time.

However you can restore the default permissions for your home folder which will probably fix most of your issues.

First reset the owner of your home folder:

sudo chown -Rv kpate352:kpate352 /home/kpate352/

Then reset permissions for all files:

find /home/kpate352/ -type f -print0 | xargs -0 sudo chmod -Rv 644

Finally reset permissions for all folders:

find /home/kpate352/ -type d -print0 | xargs -0 sudo chmod -Rv 755

This should stabilise your situation.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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