5

I've been trying to use homebrew to install python and finally gotten that to work. In the process of trying to make that work I ran:

brew list --unbrewed

and got a huge list of files (over 59,000). These files are mostly related to python, node, ruby, mongo and mysql. I've also run brew update and brew doctor and neither one of those have any effect on the unbrewed list.

It seems like not such a great idea to keep my installation in this state. So I guess I have several questions about this:

1) Is this something that I should worry about or fix?

2) Where are the unbrewed files kept? (I looked for documentation on this but couldn't find it). Many of these files don't exist at the path shown so where are they?

3) If I did want to clean this up how would I do so? And will I end up removing my installations of these packages/formulas?

kenorb
  • 155,785
  • 88
  • 678
  • 743
cartesianJoin
  • 73
  • 1
  • 7
  • Looks like I have a few random binaries and 29k android-sdk files. Most likely files that happened to be put into /usr/local by some other installer. I doubt it's anything to worry about. – Kevin Apr 26 '13 at 20:01
  • Kevin, thanks for the response. I was able to locate the files in the /usr/local directory, so I know where the files are now, but what about removing them? – cartesianJoin Apr 26 '13 at 20:16
  • As they were probably put there by another installer, you probably shouldn't touch them. /usr/local is used by more than just homebrew. – Kevin Apr 26 '13 at 20:19

1 Answers1

7

This is nothing to worry about. Homebrew is designed to play well with other things that install in to /usr/local/, which is the standard place for user-built software to go. Plenty of other things install themselves there. The brew list --unbrewed comamnd just lists all the files under /usr/local which weren't put there by Homebrew. It is not diagnostic of an actual problem, it's more for identifying stuff you might want to put under a Homebrew formula, or to help formula maintainers check for stray files while doing installation work. Any normal system will probably have a nonempty brew list --unbrewed.

Do a brew doctor instead. That checks for files in certain places under /usr/local which could actually be problematic. If brew doctor complains about something, you probably need to address that. Otherwise, don't worry about them, and don't try to clean them up - you probably put those files there for a reason.

Here's an example of what my test 10.8.3 system reports. Plenty of --unbrewed files, but doctor is happy. Homebrew is functioning just fine on it.

$ brew list --unbrewed | wc
    1721    1727   82663
$ brew doctor
Your system is ready to brew.

So:

1) No, don't worry about this or fix it unless brew doctor tells you to. Removing these files will probably break something you installed.

2) Those paths are relative to brew --prefix, which is probably /usr/local.

3) Hypothetically, to "clean it up", for each file, you'd just determine what installed it and uninstall it, reinstalling it using a Homebrew formula if it's something you actually need, or come to a conclusion that it was a mistake or no longer needed, and delete it. There's no standard or easy way to do this. And that is exactly the problem that Homebrew and other package managers exist to solve.

Some of that might be worthwhile if you want to use Homebrew more extensively to control your installations. Each time you're about to install some non-Homebrew software that sticks itself in /usr/local/, instead of following the normal installation instructions, use brew create to make a formula for it. Then homebrew will track the files it installs.

Andrew Janke
  • 23,508
  • 5
  • 56
  • 85
  • 1
    Andrew, thank you for the thorough and thoughtful answer. This is the kind of response I was hoping for. brew doctor runs fine and doesn't complain (any more :)). I've installed some of the software that is shown in the unbrewed list with brew, after the previous installation. I'm going to try to work through cleaning up what I can and I'll leave the rest. Thanks again! – cartesianJoin May 01 '13 at 15:05
  • No problem. If this worked for you, would you mind giving it an upvote and an Accept? – Andrew Janke May 01 '13 at 16:05
  • Hmmm..., I can accept it, but upvote requires 15 reputation points, which apparently I don't have. I'm absolutely new here so it's not surprising. – cartesianJoin May 01 '13 at 19:54
  • Even if doctor does say something, if it's just a warning it may be something to ignore. I'd say especially about the mono warning if you got MonoDevelop installed: https://github.com/Homebrew/homebrew/issues/14077 – cregox Jun 17 '14 at 06:23