librelist archives

« back to archive

Uninstalling

Uninstalling

From:
Ozgur Akgun
Date:
2010-09-13 @ 13:57
Hello great people of homebrew!

Great project. I'd like to use it and get rid of all that macports
non-sense. First, I am trying to understand how the system works, though.

For example, I couldn't yet figure out how uninstalling a formulae works. On
the installation page of the wiki, I got the intention that if I simply
delete the installation directory of a formulae, and run 'brew prune' (which
I couldn't find the documentation for) it would do some magic trick. But
what if the formulae installs other files to other places? I'd really like
to be able to completely uninstall something, and this to be handled
automatically.

Maybe I should look closer.

Cheers!
Ozgur

Re: [homebrew] Uninstalling

From:
Max Howell
Date:
2010-09-13 @ 13:59
Try `brew uninstall foo`.

Formula cannot install to other places. This is well documented.

> Hello great people of homebrew!
>
> Great project. I'd like to use it and get rid of all that macports
> non-sense. First, I am trying to understand how the system works, though.
>
> For example, I couldn't yet figure out how uninstalling a formulae works. On
> the installation page of the wiki, I got the intention that if I simply
> delete the installation directory of a formulae, and run 'brew prune' (which
> I couldn't find the documentation for) it would do some magic trick. But
> what if the formulae installs other files to other places? I'd really like
> to be able to completely uninstall something, and this to be handled
> automatically.
>
> Maybe I should look closer.

Yes you should.

Re: [homebrew] Uninstalling

From:
Ozgur Akgun
Date:
2010-09-13 @ 14:42
Thanks for the fast response.
I've seen it being mentioned in several places, you are right.

The following confuses me a bit though. In the formula file for
haskell-platform, it mentions that during upgrades the user should go ahead
and delete some files from ~/.ghc/.. Surely that is not under usr/local :)
Is that a directory ghc creates on itself, and is not in the responsibility
of brew for that reason?

How does in general homebrew make sure the formulas do not put files in
random places? Pointers to that mechanism maybe?
Or is this achieved by closely examining every individual formula file?

Best,

On 13 September 2010 14:59, Max Howell <max@methylblue.com> wrote:

> Try `brew uninstall foo`.
>
> Formula cannot install to other places. This is well documented.
>
> > Hello great people of homebrew!
> >
> > Great project. I'd like to use it and get rid of all that macports
> > non-sense. First, I am trying to understand how the system works, though.
> >
> > For example, I couldn't yet figure out how uninstalling a formulae works.
> On
> > the installation page of the wiki, I got the intention that if I simply
> > delete the installation directory of a formulae, and run 'brew prune'
> (which
> > I couldn't find the documentation for) it would do some magic trick. But
> > what if the formulae installs other files to other places? I'd really
> like
> > to be able to completely uninstall something, and this to be handled
> > automatically.
> >
> > Maybe I should look closer.
>
> Yes you should.


-- 
Ozgur Akgun

Re: [homebrew] Uninstalling

From:
Douglas Creager
Date:
2010-09-13 @ 15:22
> The following confuses me a bit though. In the formula file for
> haskell-platform, it mentions that during upgrades the user should go ahead
> and delete some files from ~/.ghc/.. Surely that is not under usr/local :)
> Is that a directory ghc creates on itself, and is not in the responsibility
> of brew for that reason?

I doubt Homebrew will try to delete any of those ~/.ghc files.  Those
are most likely created by the Haskell compiler once you start to use it
— they're not created as part of installing the formula.  So Homebrew
can't (and doesn't) do anything to track those files.  It would be like
asking a Microsoft Word uninstaller to remove all of the .doc files you
might've created at some point.

> How does in general homebrew make sure the formulas do not put files in
> random places? Pointers to that mechanism maybe?
> Or is this achieved by closely examining every individual formula file?

I don't think anything actively prevents you from putting a file in a
random place, but the helper methods that make it easy to write formulas
cause the software to get installed into the right place.  Tracing
through how all of the different classes cooperate to do this is a good
exercise in understanding how the Homebrew infrastructure works.

Re: [homebrew] Uninstalling

From:
Adam Vandenberg
Date:
2010-09-13 @ 16:02
There used to be code enabled, see brew_events, that would check for
files being installed outside of the prefix, but it was buggy and
gross and hanging builds for some people so it was disabled.

On Mon, Sep 13, 2010 at 8:22 AM, Douglas Creager <dcreager@dcreager.net> wrote:
>> The following confuses me a bit though. In the formula file for
>> haskell-platform, it mentions that during upgrades the user should go ahead
>> and delete some files from ~/.ghc/.. Surely that is not under usr/local :)
>> Is that a directory ghc creates on itself, and is not in the responsibility
>> of brew for that reason?
>
> I doubt Homebrew will try to delete any of those ~/.ghc files.  Those
> are most likely created by the Haskell compiler once you start to use it
> — they're not created as part of installing the formula.  So Homebrew
> can't (and doesn't) do anything to track those files.  It would be like
> asking a Microsoft Word uninstaller to remove all of the .doc files you
> might've created at some point.
>
>> How does in general homebrew make sure the formulas do not put files in
>> random places? Pointers to that mechanism maybe?
>> Or is this achieved by closely examining every individual formula file?
>
> I don't think anything actively prevents you from putting a file in a
> random place, but the helper methods that make it easy to write formulas
> cause the software to get installed into the right place.  Tracing
> through how all of the different classes cooperate to do this is a good
> exercise in understanding how the Homebrew infrastructure works.
>
>

Re: [homebrew] Uninstalling

From:
Ozgur Akgun
Date:
2010-09-13 @ 16:56
Douglas and Adam,

Thanks for both answers.

I see the analogy between doc files and the .ghc directory, but .ghc
directory is (at least optionally) something that should go away once you
delete the haskell compiler. Whereas, haskell source files, and the binaries
created using the compiler should not. Just a small follow-up question, is
there a way to write a custom uninstall method, or hook some actions
before/during/after uninstallation occurs?

And about the prefix check part, if I were a developer of brew I'd think
about how to limit an arbitrary formula to put files in arbitrary places.
Examining formulas (by hand) before adding them to the main branch is good,
but I think, at least this simple check could be automated. Machines are
cheaper than brainz :) [and let's admit, more accurate as well]

BTW, I've started using brew, and it's all great.

Ozgur

Re: [homebrew] Uninstalling

From:
Adam Vandenberg
Date:
2010-09-13 @ 16:58
(A) For NPM, I added a line to the caveats "hey this thing puts a
dotfile in your home directory...", so at the very least, we could
message that for things like GHC that put a lot of junk in the
dot-folder.

(B) Homebrew doesn't have any uninstall/unlink hooks (by design).

On Mon, Sep 13, 2010 at 9:56 AM, Ozgur Akgun <ozgurakgun@gmail.com> wrote:
> Douglas and Adam,
> Thanks for both answers.
> I see the analogy between doc files and the .ghc directory, but .ghc
> directory is (at least optionally) something that should go away once you
> delete the haskell compiler. Whereas, haskell source files, and the binaries
> created using the compiler should not. Just a small follow-up question, is
> there a way to write a custom uninstall method, or hook some actions
> before/during/after uninstallation occurs?
> And about the prefix check part, if I were a developer of brew I'd think
> about how to limit an arbitrary formula to put files in arbitrary places.
> Examining formulas (by hand) before adding them to the main branch is good,
> but I think, at least this simple check could be automated. Machines are
> cheaper than brainz :) [and let's admit, more accurate as well]
> BTW, I've started using brew, and it's all great.
>
> Ozgur

Re: [homebrew] Uninstalling

From:
Mike McQuaid
Date:
2010-09-13 @ 17:27
On 13 Sep 2010, at 17:58, Adam Vandenberg wrote:

> (A) For NPM, I added a line to the caveats "hey this thing puts a
> dotfile in your home directory...", so at the very least, we could
> message that for things like GHC that put a lot of junk in the
> dot-folder.

I'd bet 90% of stuff in homebrew will stick things in your home directory 
if you run them. I think it's unreasonable for users to expect developers 
to document this, no Linux package manager does so.

--
Cheers,
Mike McQuaid
http://mikemcquaid.com

Re: [homebrew] Uninstalling

From:
Matthieu Dubet
Date:
2010-09-13 @ 17:32
Sure, it's just obvious that softwares have preferences files per user, we
don't have to caveat each one ...

On Mon, Sep 13, 2010 at 7:27 PM, Mike McQuaid <mike@mikemcquaid.com> wrote:

>
> On 13 Sep 2010, at 17:58, Adam Vandenberg wrote:
>
> > (A) For NPM, I added a line to the caveats "hey this thing puts a
> > dotfile in your home directory...", so at the very least, we could
> > message that for things like GHC that put a lot of junk in the
> > dot-folder.
>
> I'd bet 90% of stuff in homebrew will stick things in your home directory
> if you run them. I think it's unreasonable for users to expect developers to
> document this, no Linux package manager does so.
>
> --
> Cheers,
> Mike McQuaid
> http://mikemcquaid.com
>
>

Re: [homebrew] Uninstalling

From:
Adam Vandenberg
Date:
2010-09-13 @ 17:30
I don't mind conf files being dropped there, but langauges that make
dot-folders and then start installing stuff into there (instead of
into var or share), could be documented.

On Mon, Sep 13, 2010 at 10:27 AM, Mike McQuaid <mike@mikemcquaid.com> wrote:
>
> On 13 Sep 2010, at 17:58, Adam Vandenberg wrote:
>
>> (A) For NPM, I added a line to the caveats "hey this thing puts a
>> dotfile in your home directory...", so at the very least, we could
>> message that for things like GHC that put a lot of junk in the
>> dot-folder.
>
> I'd bet 90% of stuff in homebrew will stick things in your home 
directory if you run them. I think it's unreasonable for users to expect 
developers to document this, no Linux package manager does so.
>
> --
> Cheers,
> Mike McQuaid
> http://mikemcquaid.com
>
>