0

I apologise in advance for poor formatting because my laptop isn't working anymore. I'm on mobile.

I accidentally changed the permissions of /usr/lib to 777 (recursively, with -R). Everything was working fine till I restarted my laptop. Post-restart, my Wifi-adapter couldn't be found, so I have no access to WiFi on my laptop, and sudo stopped working, because the file /usr/lib/sudo/sudoers.so needs certain permissions but my sweeping change changed it to 777.

I booted up in a live environment using a USB installation medium, and entered the terminal as root. I typed the following in the terminal:

# chmod go-w -R /usr/lib

But none of the permissions were changed, and for each file contained within I got the message "No space left on device".

I tried to only change the permissions of the top-level directory, as

# chmod go-w /usr/lib

and also

# chmod 744 /usr/lib

Both these commands excuted with no error but no stdout either. Upon typing "ls -l" I see that the permissions have not been changed, and /usr/lib still has permissions lrwxrwxrwx.

I mounted /usr (which I know is /dev/sda6 on my laptop) and performed the operations on /mnt/lib but it made no difference. What's going on, and how do I fix this?

6
  • 2
    Are you in a position to back up and reinstall the operating system?
    – John
    May 23, 2022 at 18:36
  • Most of my important data is backed up and I could reinstall with the same USB live installation medium. Is that the only option? And any idea why chmod isn't working? May 23, 2022 at 18:42
  • Wholesale permission changes will have changed numerous things and it is unlikely you would catch them all.
    – John
    May 23, 2022 at 18:43
  • /usr/lib from a live environment booted using a USB installation medium is not the /usr/lib of your main OS. /mnt/lib might be, if you mounted the right filesystem, but we cannot tell. When you say "I accidentally changed the permissions of /usr/lib to 777", do you mean chmod with or without -R/--recursive? Probably with, but please state it explicitly. May 23, 2022 at 18:53
  • I used the '-R' recursive and the chmod was performed in my main OS. I'm certain that /dev/sda6 is /usr and so /mnt/lib is /usr/lib of main OS. This is because I previously changed the permissions of /usr/bin to 777, and I was able to revert that in a live environment. I had to mount /usr so I used dk in my main OS and found out that /usr is /dev/sda6. Which is why I'm confused why changing the permissions of /usr/bin was reversible but /usr/lib seems to have messed up my system and I can't undo it with chmod in a live env... May 23, 2022 at 18:57

1 Answer 1

1

A wholesale change to all permissions would change many items.

It is unlikely you could catch them all to back out the changes.

So then, make sure you have a backup and reinstall the operating system. That is likely the only practical choice at this point.

2
  • I'm afraid John is right. FWIW, Timeshift or a good full system backup strategy would save you.
    – gronostaj
    May 23, 2022 at 19:32
  • I reinstalled the OS. I couldn't install software because of an 'Incorrect permission on /usr/lib/policykit-1/' error, but this seems to be a common error with a fix and everything is working now. It's funny though, the first time I installed the OS I didn't have this problem...so is it a coincidence or some sort of lingering effect? May 23, 2022 at 19:56

You must log in to answer this question.

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