PDA

View Full Version : Is it safe to delete /usr?


jykim0806
Jun 16, 2013, 01:17 PM
Hi, I was going through folders to clean some unused files, and I confronted this /usr folder inside Macintosh HD.
Now, I deleted /usr/local folder because it is not part of the system files and they don't come with the clean install, but I was not sure if it is safe to delete /usr as a whole. Any ideas?

Bear
Jun 16, 2013, 01:20 PM
Not safe at all to delete.

Intell
Jun 16, 2013, 01:21 PM
You shouldn't delete anything in /usr, even /usr/local/. Doing so could cause major problems with your OS and cause it to not boot.

jykim0806
Jun 16, 2013, 01:22 PM
Not safe at all to delete.

But /usr/local was safe to delete right?

w0lf
Jun 16, 2013, 01:26 PM
No it is not safe. You'll probably not be able to boot or have seriously messed up os if you delete that.

Those are system files and some how the hidden flag got removed.

Open terminal
Type

chflags hidden /usr

Press return

Bear
Jun 16, 2013, 01:36 PM
But /usr/local was safe to delete right?I don't know as I don't know what software you had installed on your computer that needed /usr/local

jykim0806
Jun 16, 2013, 02:27 PM
I don't know as I don't know what software you had installed on your computer that needed /usr/local

I looked at this http://superuser.com/questions/593593/is-it-safe-to-delete-usr-local-for-a-clean-reinstall-of-misc-stuff-on-osx, and I just wanted to confirm it's safe. I had osxfuse on usr/local.

CyBeRino
Jun 16, 2013, 05:49 PM
It is safe to remove /usr/local (though you may break third-party software) but /usr itself is absolutely vital to the OS and you will be looking at a re-install if you delete it.

jykim0806
Jun 16, 2013, 05:55 PM
It is safe to remove /usr/local (though you may break third-party software) but /usr itself is absolutely vital to the OS and you will be looking at a re-install if you delete it.

Thanks a lot!

SlCKB0Y
Jun 17, 2013, 12:53 AM
but I was not sure if it is safe to delete /usr as a whole. Any ideas?

Not trying to sound like an arse, but if you have to ask this question, you probably shouldn't be doing what you are doing.

I also think you should have removed the contents of /usr/local rather than the directory itself.

A much better way to save space is to disable things like the sleepimage file (assuming you dont need it). However much RAM your Mac has is how much you'll save in diskspace. Disabling TimeMAchine from storing local backups and removal of text-to-speech voices can also save a significant amount of space.

benwiggy
Jun 17, 2013, 02:04 AM
Not trying to sound like an arse, but if you have to ask this question, you probably shouldn't be doing what you are doing.
I agree, on two fronts: firstly, going around the disk deleting any folders whose purpose you are unsure of is going to get you into trouble; and secondly: I would expect a greater degree of knowledge from someone who is beta-testing pre-release software.


A much better way to save space is to disable things like the sleepimage file (assuming you dont need it). However much RAM your Mac has is how much you'll save in diskspace. Disabling TimeMAchine from storing local backups and removal of text-to-speech voices can also save a significant amount of space.
I would advise against either of these. The sleep image is important on any laptop, and without it battery life while the lid in closed is lessened. You will lose any unsaved files when the battery runs out, too.
Similarly, local backups will get deleted if the OS needs the space for something else.

ScottishCaptain
Jun 17, 2013, 02:07 AM
/usr/local is safe to delete. As is /usr/opt.

/usr is NOT safe to delete.

If you do that, you will probably render your system unbootable.

-SC

Embio
Jun 17, 2013, 02:11 AM
....I do not understand this. Why would you need to delete /usr?? An 800MB+ folder that is hidden by default is obviously important.

ScottishCaptain
Jun 17, 2013, 04:35 AM
....I do not understand this. Why would you need to delete /usr?? An 800MB+ folder that is hidden by default is obviously important.

Your average Mac user does not know this, that is why those folders are hidden by default. Something on his system has somehow unhidden that folder, making it visible. Most users when presented with a similar scenario will assume that since they've never seen it before, it can probably be deleted.

-SC

maflynn
Jun 17, 2013, 05:56 AM
I too have to ask why do you want to delete it OP, the space is inconsequential and the risk is high when you're removing system files/folders that were installed by OSX.

Anything in the root directory, I leave alone, its not meant to be mucked with.

My only other piece f advice is to have a backup before you opt to delete anything as you may find yourself with a non-booting machine and will need to install OSX again.

SlCKB0Y
Jun 17, 2013, 10:26 PM
I would advise against either of these. The sleep image is important on any laptop, and without it battery life while the lid in closed is lessened. You will lose any unsaved files when the battery runs out, too.

All valid points but in my instance, I have a Macbook Pro with 16GB of RAM and an SSD. I simply wasn't willing to trade 16GB of SSD space for the benefits offered by having the sleepimage. :D

Galaxas0
Jun 18, 2013, 12:35 AM
The following folders are the only ones that should be visible in the root directory, except those you have made (this is a bad idea though): Applications, System, Library, Users, Groups (on OS X Server installs).

If it's not one of the above, IT SHOULD BE A HIDDEN FILE. NOT DELETED.