Can I do this?

sudo chown -R myUsernName /usr/lib

I mean can I do this without worrying that my OS will be broken? Or permissions will be screwed up?

Here is the reason why I would like to do it

and here is why I don't and I came here to ask you guys:

  • @The Evil Phoenix Sorry I misspelled chown, do you mean this for chmod or chown? – Adam Halasz Jul 19 '11 at 18:23
  • 5
    A better question is why are you doing this? – Marco Ceppi Jul 19 '11 at 18:30
  • 3
    Concur with @Marco - this seems like a tremendously bad idea at /best/, with absolutely no potential benefit that springs to mind. – Shadur Jul 19 '11 at 19:01

Two things:

(1) There is absolutely no advantages for this. The files in /usr/lib are supposed to be owned by root/system, as MANY things on the system which are owned by root are dependent on them.

(2) This is also a very good way to break your system.-

Just to make a point, follow this general rule of thumb:
If in doubt, don't do it.


Given that sudo is /usr/bin/sudo normally, you won't be able to use it after you run that chown command: the sudo binary owner will be yourself, so you won't get root permissions when running it next time.

So don't do that.

  • This specific answer probably belongs on one of the linked questions... this question refers specifically to /usr/lib/ – Thomas Ward Dec 2 '14 at 19:58


If you don't completely understand the reasons for the permissions of the files on your system, don't change them.

Generally speaking, files outside your home directory or /tmp or designated directories for data should belong to system users, not to you.

Furthermore, you should not write under /usr, with the exception of /usr/local: this is reserved for your distribution or package manager. If you want to install a program system-wide, install it under /usr/local.

That installation script looks like it's trying to install in the wrong places. If it tries to copy things to /usr/lib, it's broken. Don't use it. Look for a package for your distribution, or for a better installation script, or better installation instructions. Again, if things end up in /usr/lib (as opposed to /usr/local/lib) without going through a package manager, the installation process is broken.

  • 2
    @CIRK: Please note this, what Gilles is saying is true. Anything that tries to run an install to /usr (not /usr/local) NOT through your distributions package manger IS BROKEN. Changing the permissions on /usr WILL LIKEWISE BREAK YOUR SYSTEM. Don't do it. Worst case senario, download the script and edit it to change all the paths to something else before you run it. Best case, find a real package that installs in your user folder or /usr/local. – Caleb Jul 19 '11 at 21:18

No, it is not safe: the permissions in /usr/lib are chosen for two reasons:

  • guarding against accidental modification of the system programs, and
  • providing privileged access to various features of the system, e.g., using setuid/setgid programs.

You can see the latter using

find /usr/lib -type f -perm /7000

to search for any program using setuid (4000) or setgid (2000) or sticky bit (1000). On my Debian7, that shows several files:


If you change the ownership of those files, they can no longer perform the task for which they are designed. For instance, gnome-pty-helper and utempter are used to update the utmp/wtmp feature (providing data for w and last).

Further reading:

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.