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?
/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
to777
", do you meanchmod
with or without-R
/--recursive
? Probably with, but please state it explicitly.