6

I interrupted the execution of homebrew while installing. Consequently, I ran into a problem mentioned here Error found when loading /home/user/.profile:. I had to comment eval statements in the configuration file to solve the problem. However, I completely want to remove brew. Kindly, suggest any solution.

Lawhatre
  • 187

3 Answers3

4

I installed brew with the homebrew install script which installs in /home/linuxbrew/.

I just found that one folder, where it resided, I removed that, and freed up 3GB:

sudo rm /home/linuxbrew/ -Rf

Check for remaining brew components with

locate -e brew | egrep -iv '(hebrew|ansible)' | grep brew
Pablo Bianchi
  • 17,371
rubo77
  • 34,024
  • 52
  • 172
  • 299
2

From SO and documentation:

  1. Remove with the provided uninstallation script

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
    

    As always, before running any script from internet on your machine, it is a good practice to read the source code to check if it only does what it should.

  2. Remove directories for some reason not removed by the uninstaller:

    sudo rm -rf /home/linuxbrew/
    
  3. Also remove the following line from ~/.profile:

     eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
    

    Otherwise, you will get this awful blocking message while trying to login.

Run sudo du -sh /home/linuxbrew/ to compare the space gain (probably at least 1GB).

Pablo Bianchi
  • 17,371
1

You can use this to check if it left anything behind in one of the system directories:

https://github.com/shundhammer/qdirstat/blob/master/doc/Unpkg-View.md

You'll still have to carefully go through your home directory to check if it left anything behind there.

HuHa
  • 3,525