0

I "accidentally" ran

sudo chmod -R 0755 /usr/lib

And now many things in my system don't work. Is there a cure for this (Manjaro 17.1) that doesn't involve re-installing my entire system?

1 Answers1

2

For a complete and proper fix, you're probably looking at restoring from a backup (you do have a backup, right?) or reinstall. Just doing an ad-hoc find /usr/lib -type f -exec ls -l "{}" \; | grep '^-..x..x..x' on one of my boxen shows a vast scattering of non-directories which should be executable on your host. But not everything is meant to be executable.

DopeGhoti
  • 76,081
  • Egad, don’t parse the output of ls!  Do find /usr/lib -type f -perm -111 (or, perhaps more usefully, -perm /111).  Or, if you have GNU find, you can use -executable, but that’s of dubious usefulness.  If checks whether the file is executable by you, so, if you aren’t root, it will miss files with modes like 744. – G-Man Says 'Reinstate Monica' Jan 03 '18 at 22:30
  • Not to mention not everything should be 0644 or 0755 either. E.g., 4755 for /usr/lib/openssh/ssh-keysign on my Debian box. I would guess loss of set-id bits is what broke the system. – derobert Jan 03 '18 at 22:32
  • BTW: An alternative you might suggest is to install a different machine (or VM) with a fresh install with the same packages. Then copy the permissions over. – derobert Jan 03 '18 at 22:35