17

I installed homebrew on ubuntu 19.04 and it's accidentally stop, so the install not complete. but the folder already created.

If I install it again

sudo apt install linuxbrew-wrapper

I get a message:

linuxbrew-wrapper is already the newest version

but if I write command :

brew upgrade

I get this message:

Command 'brew' not found, but can be installed with:

sudo apt install linuxbrew-wrapper".

Can anyone help me fix this?

James Moore
  • 8,636
  • 5
  • 71
  • 90
walid thalib
  • 179
  • 1
  • 1
  • 9

5 Answers5

43

Maybe this can help more people...

I just executed the following command line

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

This is the same url as in here Homebrew homepage but instead of install.sh, I used uninstall.sh.

homebrew uninstall

Neur0
  • 367
  • 5
  • 13
mlecar
  • 729
  • 6
  • 9
13

After performing what https://stackoverflow.com/a/57208010/2787992 said, you might need to run

sudo rm -rf /home/linuxbrew
iChux
  • 2,266
  • 22
  • 37
11
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"

sudo rm -rf /home/linuxbrew

For details see: https://www.how2shout.com/linux/how-to-install-brew-ubuntu-20-04-lts-linux/

4b0
  • 21,981
  • 30
  • 95
  • 142
maestrom4
  • 111
  • 1
  • 3
4

Source your bashrc first

source ~/.bashrc 
General Grievance
  • 4,555
  • 31
  • 31
  • 45
4

Try uninstalling the packages.

To remove just linuxbrew-wrapper package

sudo apt-get remove linuxbrew-wrapper

If you want to delete configuration and data files

sudo apt-get purge linuxbrew-wrapper
  • 1
    thanks man, after i install it again, it say "E: Linuxbrew directory detected, but it seems broken. Try to remove '/home/linuxbrew/.linuxbrew' and install again." – walid thalib Jul 25 '19 at 18:32
  • @walidthalib was this commands executed ? Did you able to install it again after deleting the directory ? – Manuja Jayawardana Jul 26 '19 at 05:41
  • yes, i executed. But the directory still exist in home/linuxbrew/ . So if i install it again it's not complete. – walid thalib Jul 26 '19 at 15:47
  • Note: linuxbrew-wrapper appears to no longer be relevant in 2023. I recommend using the official Linuxbrew instructions – Ben Creasy Jul 10 '23 at 06:10