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/

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

1 Answer 1

6

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.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .